Hello,
I have been working on a data problem for a little while now. I am looking for some good direction of where to go from here.
I created a SqlDataAdapter, SqlConnection, and a DataTable. I instantiate my SqlAdapter with a storedprocedure and my SqlConnection. Then I populate the DataTable with the results of the SqlDataAdapters fill method. Finally I bind this DataTable to a DataGrid that I display to users on an ASPX page.
Now my troubles begin.
From here I added two columns (with editable textbox objects in them) to the end of the DataGrid.
<ItemTemplate>
<asp:TextBox runat="server" ID="txtMeas" "50px" /> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn HeaderText="Comments"> <ItemTemplate>
<asp:TextBox runat="server" ID="Textbox1" />
</ItemTemplate>
I want to be able to fill a SQL table with results from the DataGrid (including the textbox columns) and several other pieces of data all merged together.
I have not had much luck doing this in a .Net fasion. I know that I could accomplish this by turning all of the data in the datagrid into arrays or collections and then iterating through the arrays and manipulating the data. If I were to go about this method then why am I using all of these high level objects? I feel like I should just go back to creating a sql command and getting resultsets that I turn into arrays.
Any guidance would be greatly appreciated. Some example code of creating custom columns, and rows in DataSets, DataGrids, or DataTables would be very helpfull. I have found it very hard to add columns to any of these object unless I add the columns to the end of them.
I have been working on a data problem for a little while now. I am looking for some good direction of where to go from here.
I created a SqlDataAdapter, SqlConnection, and a DataTable. I instantiate my SqlAdapter with a storedprocedure and my SqlConnection. Then I populate the DataTable with the results of the SqlDataAdapters fill method. Finally I bind this DataTable to a DataGrid that I display to users on an ASPX page.
Now my troubles begin.
From here I added two columns (with editable textbox objects in them) to the end of the DataGrid.
<ItemTemplate>
<asp:TextBox runat="server" ID="txtMeas" "50px" /> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn HeaderText="Comments"> <ItemTemplate>
<asp:TextBox runat="server" ID="Textbox1" />
</ItemTemplate>
I want to be able to fill a SQL table with results from the DataGrid (including the textbox columns) and several other pieces of data all merged together.
I have not had much luck doing this in a .Net fasion. I know that I could accomplish this by turning all of the data in the datagrid into arrays or collections and then iterating through the arrays and manipulating the data. If I were to go about this method then why am I using all of these high level objects? I feel like I should just go back to creating a sql command and getting resultsets that I turn into arrays.
Any guidance would be greatly appreciated. Some example code of creating custom columns, and rows in DataSets, DataGrids, or DataTables would be very helpfull. I have found it very hard to add columns to any of these object unless I add the columns to the end of them.