When I execute the following code on a WebForm I get the
following message:
Object reference not set to an instance of an object.
This error occurs at the dataConnection. ConnectionStrin g
command.
public void OpenWorkorder()
{
string connStr
= "Provider=MSDAO RA.1;User ID=maximo;Data
Source=Demo;Pas sword=xxxxxx";
dataConnection. ConnectionStrin g =
connStr;
dataConnection. Open();
string strSelect = "Select Wonum
from Workorder where Wonum =" + workorderText.T ext;
dataCommand.Con nection =
dataConnection;
dataCommand.Com mandText =
strSelect;
dataCommand.Exe cuteReader();
while (dataReader.Rea d())
{
string Wonum =
dataReader.GetS tring(1);
wonumLabel.Text = Wonum;
}
dataReader.Clos e();
dataConnection. Close();
If anyone could help, Please
Dave
following message:
Object reference not set to an instance of an object.
This error occurs at the dataConnection. ConnectionStrin g
command.
public void OpenWorkorder()
{
string connStr
= "Provider=MSDAO RA.1;User ID=maximo;Data
Source=Demo;Pas sword=xxxxxx";
dataConnection. ConnectionStrin g =
connStr;
dataConnection. Open();
string strSelect = "Select Wonum
from Workorder where Wonum =" + workorderText.T ext;
dataCommand.Con nection =
dataConnection;
dataCommand.Com mandText =
strSelect;
dataCommand.Exe cuteReader();
while (dataReader.Rea d())
{
string Wonum =
dataReader.GetS tring(1);
wonumLabel.Text = Wonum;
}
dataReader.Clos e();
dataConnection. Close();
If anyone could help, Please
Dave
Comment