C # Expert Group: 207364916 expect you to join privatevoidForm1_Load (objectsender, EventArgse) {declare a SQLconnection object SqlConnectionsqlnewSqlConnection (serverWINDOWS-UBBCFE0; databaseVCD; uidsa; pwd123); declare a SQLcommand object SqlComman
C # Expert Group: 207364916 expect you to join the private void Form1_Load (object sender, EventArgs e) {// declare a SQLconnection object SqlConnection SQL = new SqlConnection (server = WINDOWS-UBBCFE0; database = VCD; uid = sa; pwd = 123); // declare a SQLcommand object SqlComman
C # Expert Group: 207364916 we look forward to your participation
Private void Form1_Load (object sender, EventArgs e)
{
// Declare a SQLconnection object
SqlConnection SQL = new SqlConnection ("server = WINDOWS-UBBCFE0; database = VCD; uid = sa; pwd = 123 ");
// Declare a SQLcommand object
SqlCommand sqlcmd = new SqlCommand ("SELECT Name FROM SysObjects Where XType = 'U' order by Name", SQL );
// Declare an object with DataAdapter
SqlDataAdapter sda = new SqlDataAdapter ();
// Execute the query statement
Sda. SelectCommand = sqlcmd;
// Create a DataSet object
DataSet ds = new DataSet ();
// Call the Fill () method of the DataAdapter object to Fill the dataset
Sda. Fill (ds, "Name ");
// Bind the combobox Dataset
ComboBox1.DataSource = ds. Tables ["Name"];
// Select the members displayed in combobox and display the Name column in combobox
ComboBox1.DisplayMember = "Name ";
}
Result After execution