Good evening. I have a GridView linked to an Access 2000 database. The
GridView has a template field with a checkbox to allow the user to select
records. What I want to do is then take those selected records and insert
them into an MS SQL database. After hours of reading online and trying to
figure this out, I still remain confused on how to accomplish this using C#
and ado.net. Please note, I am not trying to copy the entire table from
Access, just certain fields from the table. I am using this code to confirm
that I can successfully determine which records have been selected in the
GridView, but now I'm stuck. Here's the code I have so far, which right now
is writing the list of selected records to an asp label:
protected void InsertSelected_Click(object sender, EventArgs e)
{
string machName = *""*;
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox ckBox = (CheckBox)row.FindControl(*"RowSelect"*);
if (ckBox.Checked)
{
machName +=
Convert.ToString(row.Cells[*2*].Text) + *';'*;
}
}
SelectedMachines.Text = machName;
}
--
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net