0
OK we suppose that you have tables in your data base
each table should be represented in a separate form
for suppose this table is sql server
Person(CUSTOMER_ID,NAME,SALARY)
you can repserent it in a window form using a datagridview, you just drag and drop a datagridview in your Form and doubleclick the Form then add this code to the form load event handler
try
{
oConn.Open
sqlcommand oComm = new sqlCommand("SELECT CUSTOMER_ID,NAME,SALARY , oConn);
sqlDataAdapter oAdapter = new sqlDataAdapter(oComm);
dataTable dt = new datatable();
oAdapter.Fill(dt);
datagridview1.datasource = dt;
datagridview1.datamember = dt.tablename;
}
finally
{
oConn.Close();
}
you do same thing to the other tables, if you ever encounter the problem then send me your mail and I send you a video tutorial that I will do for you. OK?
Accepted 0
datagridview[columnindex,rowindex].Value = textbox.text;
0
I am trying to update my datagrid using the info from text boxes rather than using the binding navigator to directly input the information. I was hoping that I can fill in the fields with the info and click a button to update my datagrid. Is this possible? If so how?
0
By the way thanks.
0
Each page of what? I'm sorry for being this slow. I wish I could show you a picture of what I am talking about. I have a windows form opened in design view with buttons along the left side. I want to be able to click each button and access various info from the database. I also would like to update each table using this gui. Thank you for being so patient with me so far. I really appreciate your help.
0
System.Data.SqlClient.SqlConnection oConn;
oConn = new System.Data.SqlClient.SqlConnection();
oConn.ConnectionString = "Data Source=YourServer;Initial Catalog=YourDataBaseName;Integrated Security=true";
oConn.Open();
System.Data.SqlClient.SqlCommand oComm;
oComm = new System.Data.SqlClient.SqlCommand();
System.Data.DataTable dt = new System.Data.DataTable();
oComm.CommandText = "your sql query for table 1";
System.Data.SqlClient.SqlDataAdapter oAdapter;
oAdapter = new System.Data.SqlClient.SqlDataAdapter(oComm);
oAdapter.Fill(dt);
oConn.Close();
Add a datagridview to your project
datagridview1.datasource = dt;
datagridview1.datamember = dt.tablename;
that's it, for each page do the same thing
0
SQL - Storage based database. I used the Visual Studio wizard.
0
SQL - Storage based database. I used the Visual Studio wizard.
0
what kind of database did you use