Home > Software engineering >  For help, "the object reference not set to an instance of an object" what mean?????? Crash
For help, "the object reference not set to an instance of an object" what mean?????? Crash

Time:10-03

Everybody:
The younger brother is written in VB2008 a work used in the query tools, the tool, there are a lot of module in one module of code is:

But always runtime errors in the dialog box shown above!!!!!!!!!! For three days, didn't know what's the matter!!
The most let me depressed is:
The code, in addition to code variables and "WWW", the other is all I directly copied from other modules, including two Imports, in other modules, the code to run all normal!!!!!!

CodePudding user response:

Dim code As String
Code="select top 8 * from a2h4"
Dim objConnection_w As New SqlConnection (" server=128.192.38.34; The database=MyDataBase; User id=sa; Password=123456 ")
MsgBox (objConnection_w Is Nothing)
Dim objDataAdapter_w As New SqlDataAdapter ()
MsgBox (objDataAdapter_w Is Nothing)
Dim objDataSet_w As New DataSet ()
MsgBox (objDataSet_w Is Nothing)
MsgBox (objDataAdapter_w SelectCommand. Connection. ToString)
ObjDataSet_w. The Clear ()
ObjDataAdapter_w.SelectCommand.Com mandText=code
ObjDataAdapter_w. The Fill (objDataSet_w, "WWW")
Main interface. DGV1 DataSource=objDataSet_w
Main interface. DGV1 DataMember="WWW"
  • Related