On Mon, Jul 18, 2011 at 10:57 PM, DotNet Newbie <[email protected]> wrote:
> I apologize, I realize in re-reading my post that I wasn't quite
> clear. That label was just to confirm that I was successfully able to
> traverse the gridview and determine which records the user had
> chosen. Parsing the string is not where I'm stuck. My issue is
> this: I am not sure what object to use to port the selected records
> from the Access datasource of the gridview over to the SQL database
> destination table. The table structures are similar but not exactly
> the same. I am much more familiar with VBA and DAO, so maybe if I
> explain how I'd do it there, then you can tell me of an equivalent
> process I could do in ADO.Net. In DAO, I would do this series of
> steps:
>
> 1. Create a connection to the Access db (source)
> 2. Create a connection to the SQL db (destination)
> 3. Run a SELECT statement on the source table to obtain only the
> selected records and store the results in a recordset
> 4. Traverse through the results recordset and append the new records
> to the destination table.
>
> I have done some reading on DataSet and DataTable objects, but the
> reading has left me confused on when and how to use them, and whether
> that's what I need to use for this situation.
>
> Hope that helps you help me :)
------------
Make a data object :
public class Users
{
public int UserId
{
get; set;
}
public string LoginName
{
get; set;
}
public string FirstName
{
get; set;
}
// more as needed.
}
As you iterate through the checked row put the value(s) into this
class that should mimic your SQL target in schema.
Then you create a connection, populate the SPROC's parameters or you
generate the insert script dynamically. Execute the SQL command.
--
Stephen Russell
Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018
Telephone: 888.510.2667
901.246-0159 cell
--
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