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.
What you are truing to do is a basic database relationship. Just read the tutorials from the links below and you should be able to find out on your own: http://www.ucertify.com/article/how-to-create-a-relationship-between-two-tables.html http://www.databasejournal.com/feat.../SQL-Server-2005-Management-Studio-Part-2.htm
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
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.
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
Try to read from this link to see if this will help you understand the like operator: http://msdn.microsoft.com/en-us/library/aa933232%28SQL.80%29.aspx
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)
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?
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.
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.
Here are two links I found that might be useful: http://www.componentgo.com/wf/ http://blogs.windowsclient.net/radicaldesigns/archive/2008/08/27/create-calendar-user-control.aspx I haven't test it but you can take a look