Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...