JohnGreiner
Programmer
I have been using VB for a few years, but this C# thing is really killing me. I am trying to connect to a SQL Server Database using ADO. I have already added a Reference to ADO 2.7 Libraries, and I figured out how to declare my Connection Object and my Recordset Object. I cannot figure out how to set up and open a connection. Also, how do I send a SQL statement to return a Recordset?
Here is what I have finished so far:
public class Form1 : System.Windows.Forms.Form
{
public ADODB.Connection EngDatabase;
public Form1()
{
InitializeComponent();
EngDatabase.Provider = "sqloledb";
EngDatabase.DefaultDatabase = "Engineering";
I keep getting an Error. I am trying to Connect to a Server Call 'C629797-a' the Database is "Engineering" and I am using Sql Server.
Any Help would be appreciated.
Here is what I have finished so far:
public class Form1 : System.Windows.Forms.Form
{
public ADODB.Connection EngDatabase;
public Form1()
{
InitializeComponent();
EngDatabase.Provider = "sqloledb";
EngDatabase.DefaultDatabase = "Engineering";
I keep getting an Error. I am trying to Connect to a Server Call 'C629797-a' the Database is "Engineering" and I am using Sql Server.
Any Help would be appreciated.