Dear Friends,
I am designing a software in C# with SQL Server and Access as backend databases. Can anyone please help me how to access both the databases in C#. I am designing the software on a Windows XP PC.
Thank You
Dear Friends,
I am designing a software in C# with SQL Server and Access as backend databases. Can anyone please help me how to access both the databases in C#. I am designing the software on a Windows XP PC.
Thank You
The fact that you're connecting to both isn't really relevant. You would connect to each one the same way as you would if it was the only one. Are you saying that you don't know how to connect to just one? If so then you might like to follow the CodeBank link in my signature and check out my Retrieving & Saving Data thread for some ADO.NET examples. You might also like to follow the Data Walkthroughs link for some higher-level how-to topics.
2007-2013
Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs
MSDN "How Do I?" Videos: VB | C#
VBForums Database Development FAQ
My CodeBank Submissions: VB (*NEW* Pausing Code) | C#
My Blog: Using Parameters in ADO.NET | Keyboard Events | Assemblies & Namespaces
i assume your connection string is ok .and it is open.so try the following way .I am designing a software in C# with SQL Server and Access as backend databases. Can anyone please help me how to access both the databases in C#. I am designing the software on a Windows XP PC.
Code:try { SqlDataReader myReader = null; SqlCommand myCommand = new SqlCommand("select * from table", myConnection); myReader = myCommand.ExecuteReader(); while(myReader.Read()) { Console.WriteLine(myReader["Column1"].ToString()); Console.WriteLine(myReader["Column2"].ToString()); } } catch (Exception e) { Console.WriteLine(e.ToString()); }![]()
Thank You very much Friends for your suggestions. It worked fine. Even I had used # of Access in SQL Query.