Before the (generated) call to <table name>TableAdapter.Fill in the <Form>_Load method of the form containing the DataGridView control you can create an appropriate SqlConnectionStringBuilder object, assign the DataSource property of this with the appropriate server name and thenassign theSqlConnectionStringBuilder's ConnectionString property to the form's <table name>TableAdapter.Connection.ConnectionString property
. This will cause the DataGridView to load the data from the specified server.
e.g.
.
.
.
private void Users_Load(object sender, EventArgs e)
{
SqlConnectionStringBuilder cc1 = new SqlConnectionStringBuilder(
userTableAdapter.Connection.ConnectionString);
cc1.DataSource = Server;
userTableAdapter.Connection.ConnectionString = cc1.ConnectionString;
// TODO: This line of code loads data into the 'dbDataSet.User' table. You can move, or remove it, as needed.
this.userTableAdapter.Fill(this.dbDataSet.User);
}
.
.
.