Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 12th, 2004, 02:15 PM
Friend of Wrox
Join Date: Oct 2003
Location: Portsmouth, Hampshire, United Kingdom.
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default ADO.NET

Hi guys,

I am trying to populate a datagrid using a data adapter. When ever I execute the file this is the error I get: -

An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: Format of the initialization string does not conform to specification starting at index 0.

This is my Code: -

private void button1_Click(object sender, System.EventArgs e)
            string source = "Provider = Microsoft.Jet.OleDb.4.0; data source=D:\\House or Home Site\\House.mdb;";
            string Select = "SELECT * FROM Houses";
            OleDbConnection objConnection = new OleDbConnection(Select);
            OleDbCommand objCommand = new OleDbCommand(Select, objConnection);
            OleDbDataAdapter objAdapter = new OleDbDataAdapter(Select, objConnection);
            DataSet objDataSet = new DataSet();
            objAdapter.Fill(objDataSet, "Houses");
            //OleDbDataReader objDataReader = null;
            //dataGrid1.DataSource = objDataReader;
            dataGrid1.SetDataBinding(objDataSet, "Houses");

Any ideas

Adz - The World is not enough
Adz - Learning The J2EE Ways.
Reply With Quote
  #2 (permalink)  
Old May 4th, 2004, 07:05 AM
Authorized User
Join Date: Jun 2003
Location: Crowland, Lincs, United Kingdom.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts

well... one thing on your code I can see is incorrect,
OleDbConnection objConnection = new OleDbConnection(Select);
should be: OleDbConnection objConnection = new OleDbConnection(source);
try this first, the rest of the code seems to be OK.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between ADO and ADO.NET rakeshclose2u ADO.NET 2 April 23rd, 2007 03:57 AM
ADO AND ADO.NET royalsurej ADO.NET 1 November 8th, 2004 08:28 AM
How can connect VB.Net with ADO.Net? arvind_pathak VS.NET 2002/2003 1 November 6th, 2003 09:22 AM
ADO.NET with ASP.NET stu9820 ADO.NET 5 September 2nd, 2003 11:47 AM
MSDE and SQL CE (using VB.NET and ADO.NET) LEGS ADO.NET 0 July 12th, 2003 11:27 AM

All times are GMT -4. The time now is 01:58 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.