K
Ken
Hello Everyone,
I am now convinced that half a solution is still a lie!
I have seen countless examples of making changes to the
datagrid -- this I am able to that without a problem.
However, I have seen few (less than none ) examples that
show a "working" (actually works when you use the code)
example of a System.Windows.Forms.DataGrid where you
update the grid and the supporting dataset.
Here is what I have:
private void loadgrid()
{
myconn3.ConnectionString = connstr3;
mysqlcom3.Connection = myconn3;
mysqlcom3.Connection.Open();
SqlDataAdapter myad3 = new SqlDataAdapter
("SHOWPrinterList",myconn3);
myad3.Fill(mydataset3,"PRINTERLIST");
dataGrid1.DataSource = mydataset3;
dataGrid1.DataMember = "PRINTERLIST";
mycmdbuilder = new SqlCommandBuilder(myad3); ---Here is
where I am getting green lined
(incorrect syntax near "ShowPrinterList")
dataGrid1.ColumnHeadersVisible = true;
//dataGrid1.SetDataBinding(mydataset3,"PRINTERLIST");
}
I understand that you should be updating the underlying
dataset, however , I have not been able to see an example
that actually works! Nor have I been successful trying to
do the update myself. I have both 1.0 and 1.1 frameworks
to work with. Can anybody send me a simple example in C#
of a Datagrid populated by one table using a stored
procedure and that can allow an update of both the
datagrid and the dataset. I would really appreciated your
help on this
Thank You in Advance for Your Help,
Ken
I am now convinced that half a solution is still a lie!
I have seen countless examples of making changes to the
datagrid -- this I am able to that without a problem.
However, I have seen few (less than none ) examples that
show a "working" (actually works when you use the code)
example of a System.Windows.Forms.DataGrid where you
update the grid and the supporting dataset.
Here is what I have:
private void loadgrid()
{
myconn3.ConnectionString = connstr3;
mysqlcom3.Connection = myconn3;
mysqlcom3.Connection.Open();
SqlDataAdapter myad3 = new SqlDataAdapter
("SHOWPrinterList",myconn3);
myad3.Fill(mydataset3,"PRINTERLIST");
dataGrid1.DataSource = mydataset3;
dataGrid1.DataMember = "PRINTERLIST";
mycmdbuilder = new SqlCommandBuilder(myad3); ---Here is
where I am getting green lined
(incorrect syntax near "ShowPrinterList")
dataGrid1.ColumnHeadersVisible = true;
//dataGrid1.SetDataBinding(mydataset3,"PRINTERLIST");
}
I understand that you should be updating the underlying
dataset, however , I have not been able to see an example
that actually works! Nor have I been successful trying to
do the update myself. I have both 1.0 and 1.1 frameworks
to work with. Can anybody send me a simple example in C#
of a Datagrid populated by one table using a stored
procedure and that can allow an update of both the
datagrid and the dataset. I would really appreciated your
help on this
Thank You in Advance for Your Help,
Ken