Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Condition in SQL

Author  Topic 

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-31 : 17:53:25
Hello Friends,
I have a sub that checks the condition. If referecepkid = txtcontractno then it is working fine.
But if the referencepkid <> txtcontractno then i am gettting the message
"object referece not set to an instance of the object". Even though i am handling DBNULL value.
Please see below. Any Ideas..?
Thx

sql = "select referencepkid from tblcontract where referencepkid = '" & Me.txtContractNo.Text & "'"
Dim objdatarow As DataRow = dbfunctions.GetSQLDataRow(CONNECTIONSTRING, sql)

If objdatarow("referencepkid") Is DBNull.Value Then
Me.txtfulfilchk.Text = 0
Else
Me.txtfulfilchk.Text = objdatarow("referencepkid")
End If


gsgill76
Posting Yak Master

137 Posts

Posted - 2006-11-01 : 00:25:14
quote:
"object referece not set to an instance of the object"

better, if you try this in some VB/VB.NET forums.

Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-01 : 04:04:12
just a guess..

Is the function dbfunctions.GetSQLDataRow(CONNECTIONSTRING, sql), returining the proper datarow. may be your object objdatarow is not getting intialized properly?



Chirag

http://chirikworld.blogspot.com/
Go to Top of Page
   

- Advertisement -