private void Form1_Load(object sender, EventArgs e) { string query = "SELECT Company.`$_DBName`, Company.`$_ThisYearBeg`, Company.`$_ThisYearEnd`, Company.`$_PrevYearBeg`, Company.`$_PrevYearEnd`, Company.`$_ThisQuarterBeg`, Company.`$_ThisQuarterEnd`, Company.`$_PrevQuarterBeg`, Company.`$_PrevQuarterEnd`, Company.`$_Name`, Company.`$_Address1`, Company.`$_Address2`, Company.`$_Address3`, Company.`$_Address4`, Company.`$_Address5` FROM Techweb.TallyUser.Company Company ORDER BY Company.`$_DBName`"; string source = "Dsn=tally;uid=sa;password=sa;app=Microsoft® Visual Studio® 2008;wsid=SLNN-207"; OdbcConnection con = new OdbcConnection(source); OdbcCommand cmd = new OdbcCommand(query, con); con.Open();---->In this line i am getting error. //ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.// //ERROR [01S00] [Microsoft][ODBC Microsoft Access Driver]Invalid connection string attribute password // OdbcDataAdapter da = new OdbcDataAdapter(query, con); DataTable dt = new DataTable("table1"); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.DataMember = "table1"; con.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)