Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Dear Sir,

Please guide me how to add a Table 1 or 2 fields to a Combobox in Windows Form and Table from SQLserver Database.Kindly give complete code so I can apply to my project.
I'm using VS2010 and Databae SQLserver.
Combo Table Job_Category and my connection as follows:-

Imports System.Data.SqlClient
Public Class EmpEntryForm
    Dim connstring As String = "Data Source=.\SQLExpress;Initial Catalog=StudioSamra;Integrated Security=True;Pooling=False"
    
    Dim connection As New SqlConnection(connstring)
    Dim da As New SqlDataAdapter(connstring, conn)
    Dim sSql As String = "select * from Job_category" 
'Combo Table Name also Field to be add into combo is "Category"


Please help me.
Thanks.
Posted

1 solution

"Kindly give complete code so I can apply to my project."

No.

Kindly go and do some research.

This isn't difficult. How will you learn if we do your homework for you?

When you have a specific problem (other than "I can't be bothered to do it for myself") please ask a question about it. In the meantime, try Google, try your lecture notes, try something for yourself!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Mar-11 21:38pm    
Tell them, Griff! A 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900