frida Posted February 19, 2004 Posted February 19, 2004 hi again! now i have a problem, i'm use a paradox database, and i'm trying to conect to the database, i made the dsn in odbc, i'm using a paradox 5 database. when i add a odbcConnection component, i bind the component with de dsn that i made, and then i test the conection and it works, then i add a odbcCommand and bind to the conection component, but when i try to edit the command text, and select one of the table of the database, it gives me an error: object reference not set to an instance of an object and i don't know what is happening, please help me!!! thanks frida Quote
frida Posted February 20, 2004 Author Posted February 20, 2004 hi, i solved it without graphical component, this is the code: string conexion="DSN=adio"; string selectQuery="Select * from Nom10030"; OdbcConnection myconexion=new OdbcConnection(conexion); DataSet ds; OdbcDataAdapter adapter=new OdbcDataAdapter(selectQuery,myconexion); try { myconexion.Open(); ds=new DataSet(); adapter.Fill(ds,"Nom10030"); this.dataGrid1.DataSource=ds.Tables"Nom10030"].DefaultView; } catch(Exception ex) { MessageBox.Show(ex.Message); } myconexion.Close(); but i need to do this with graphicals components, i need your help, please!!! thanks a lot Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.