How To Connect SQL 6.5 Database With .NET
How To Connect SQL 6.5 Database With .NET
Today I started working on a Migration tool between PVCS Tracker and TFS.
During the debug I had a problem with the SqlConnection with the PVCS DB.
I trying couple of thing to fix the problem but nothing, then I check the DB version and saw that it's 6.5 DB.
SqlConnection is only fits for 7.0 and later, so I had to use OLE
DataTable OLEDataReader = new DataTable();
OleDbConnection sqlconn = new OleDbConnection("Provider=sqloledb;Data Source=" + SQLSERVER + ";
Initial Catalog=" + DatabaseName + ";User Id=User;Password=Password;");
sqlconn.Open();
DataSet DataSetOLE = new DataSet();
OleDbDataAdapter OLEadapter = new OleDbDataAdapter("select * from Tracker, sqlconn);
OLEadapter.Fill(DataSetOLE);
OLEDataReader = DataSetOLE.Tables[0];
foreach (DataRow OLEDR in OLEDataReader.Rows)
{
MessageBox.Show(OLEDR[0].ToString());
}