Two Table Databse Application

Discussion in 'Databases' started by jskapur, Oct 20, 2009.

  1. #1
    Hey Guys,
    This is JD, I just wanted to know if you could help me. I want to make a two table simple employee database in sql server management and then make the application in Visual Studio.
    I am okay making the Visual Studio application but I need help with linking the tables.
    The first table is all employee information like DOB, Name, Address. etc
    The secind table is all employee's medical details.

    I am not to familiar with primary and foreign key but as I understand it that will be the only way to link the tables.

    I know how to set a primary key for the first table for the Emp_ID. But not sure how to link to the second table.

    Help would be greatly appreciated.

    Thanks in advance. :confused:
     
    jskapur, Oct 20, 2009 IP
  2. rocco2004

    rocco2004 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    rocco2004, Oct 21, 2009 IP
  3. jskapur

    jskapur Active Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #3
    thanks for the quick reply, really appreciate it. Also in addition, can you please tell me anything about a search query, so users can search. So I can implement in my visual studio application.

    As I understand it, it is a "Like" query.??
    Thanks
     
    jskapur, Oct 21, 2009 IP
  4. rocco2004

    rocco2004 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Is this a web based application that you want to implement a search functionality? If you don't have much experience you can research for free search solutions that could be implemented within your site - like Google custom search.
     
    rocco2004, Oct 22, 2009 IP
  5. jskapur

    jskapur Active Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #5
    no this is a desktop application, and thanks for your last post. I have finished constructing it from the sql side, but all that is left is makeing a search forum for the users, so they can find stuff.

    But I know the sql query, Where Column1=@Column2,
    but with that you need to type in the exact thing you are searching.
    I want something where you can type in like the first letter, and gett all the results with that letter in it.
    I understand that is using LIKE query. I am using visual studio C# edition, 2008 if that helps.

    thanks
     
    jskapur, Oct 22, 2009 IP
  6. rocco2004

    rocco2004 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    rocco2004, Oct 22, 2009 IP
  7. jskapur

    jskapur Active Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #7
    Thanks so much for all your help I really appreciate it. I found the code which is
    LIKE @column1 + '%%'
    Code (markup):
    Thanks

    In addition, can you please let me know how to add a picture to my employee table. I have put a column called Picture, which I have set the property in SQL to image.

    But how do I let my user, add a picture from my visual studio application. (I am using VS 2008)
     
    jskapur, Oct 22, 2009 IP
  8. rocco2004

    rocco2004 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    In this cases I usually save images in the file system rather than the database. I will just save the path to the image in the DB. It gets a better performance especially with big images. Do you have a reason to save the entire image in the database?
     
    rocco2004, Oct 23, 2009 IP
  9. jskapur

    jskapur Active Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #9
    Yes because this application will be installed on many computers, so the pictures should be on the server. But what I have done is created a shared folder on the server and then I link the photos to the folder which is on the shared folder, so everyone can access it.

    Thanks so much for your help.

    Also do you know anyway to select multiple dates on the calendar. As for the days the employees take leave, they would take days together. So would you know how I would go about that.

    Thanks again.

    Please let me know if I could help you in anyway, as you have been so great in helping me. :) :cool:
     
    jskapur, Oct 23, 2009 IP
  10. rocco2004

    rocco2004 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I assume at this point that you are using Windows Forms or WPF to develop the application. Just search for windows forms calendar control in Google and you will find many free and paid solutions that you could implement within your project. :cool:
     
    rocco2004, Oct 23, 2009 IP
  11. rocco2004

    rocco2004 Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    rocco2004, Oct 23, 2009 IP
  12. jskapur

    jskapur Active Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #12
    thank you, I will check these links, test them and I will let you know if they work.
    Thank you.
     
    jskapur, Oct 25, 2009 IP