On Tue, 2002-11-12 at 11:06, Daniel Morgan wrote: > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:mono-list-admin@;ximian.com]On > Behalf Of Brian Ritchie > Sent: Tuesday, November 12, 2002 12:04 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [Mono-list] DbDataAdapter in ADO.NET Provider Factory > > > Daniel, > > Thanks for reminding me about the DataAdapter...we wouldn't want Tim's hard > work to go to waste. :-) > > I've jacked in data adapter support. I'm using the app.config to supply the > type names (instead of hard coding it in the factory). > > Here's the syntax: > > // Create Connection > IDbConnection conn = > ProviderFactory.CreateConnectionFromConfig("TdsPubsConnStr"); > > // Select command > IDbCommand cmd=conn.CreateCommand(); > cmd.Text="select * from author"; > > // Data Adapter > DataSet ds=new DataSet(); > IDbDataAdapter adapter=ProviderFactory.CreateDataAdapter(cmd); > adapter.Fill(ds, "Table1"); > > -- or for the lazy among us :) -- > > // Create Connection > IDbConnection conn = > ProviderFactory.CreateConnectionFromConfig("TdsPubsConnStr"); > > // Data Adapter > DataSet ds=new DataSet(); > IDbDataAdapter adapter=ProviderFactory.CreateAdapter(conn, "select * from > author"); > adapter.Fill(ds, "Table1"); > > --- or for the super lazy among us (like me) --- > > // Create Connection > IDbConnection conn = > ProviderFactory.CreateConnectionFromConfig("TdsPubsConnStr"); > > // Data Adapter > DataSet ds=DataTools.FillDataSet(conn, "select * from author"); > > > Let me know if this will work for you. I'm should have the code committed > this evening. (I hope). > looks really nice!
cheers -- Rodrigo Moya <[EMAIL PROTECTED]> _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
