My bad. Should be:
 If Not (System.Convert.IsDBNull(rs("Commodity"))) Then 
C1 = rs("Commodity) 
End If

 On 7/3/05, Ryan Olshan <[EMAIL PROTECTED]> wrote: 
> 
> You should be using something similar to:
>  If Not (System.Convert.IsDBNull(rs("Commodity"))) Then 
> C1 = CType(rs("Commodity"), String) 
> End If
>  Ryan Olshan
>  
> 
>  On 7/3/05, Nirmal Abraham <[EMAIL PROTECTED]> wrote: 
> > 
> > 
> > Private Sub txtRegno_TextChanged(ByVal sender As System.Object, ByVal e 
> > As System.EventArgs) Handles txtRegno.TextChanged
> > 
> > lblResult.Text = ""
> > 
> > Dim rs As SqlDataReader
> > 
> > Dim a1, a2, s1, s2, C1, C2, m1, m2 As String
> > 
> > Dim st1, st2 As String
> > 
> > Dim su1, su2 As String
> > 
> > Dim tt1, tt2 As String 
> > 
> > Dim tu1, tu2 As String
> > 
> > Dim con As New 
> > SqlConnection("database=operation;uid=sa;pwd=;server=lc2000")
> > 
> > Dim Cmd As New SqlCommand("Vessel_View", con)
> > 
> > Cmd.CommandType = CommandType.StoredProcedure 
> > 
> > With Cmd.Parameters
> > 
> > .Add("@xRegno", txtRegno.Text)
> > 
> > End With
> > 
> > con.Open()
> > 
> > rs = Cmd.ExecuteReader(CommandBehavior.SingleRow)
> > 
> > Session.LCID = 2057
> > 
> > 
> > 
> > If rs.Read Then 
> > 
> > txtRegno.Text = rs("regno")
> > 
> > txtVessel.Text = rs("vesselname")
> > 
> > txtV2.Text = rs("Berth")
> > 
> > txtV3.Text = rs("VslBerth_dt")
> > 
> > txtV4.Text = rs("VslBerth_Time") 
> > 
> > DropImpExp.SelectedValue = rs("Imp_Exp")
> > 
> > a1 = rs("Agent")
> > 
> > a2 = rs("AName")
> > 
> > C1 = rs("Commodity")--Here the Error is Null
> > 
> > C2 = rs("CName") 
> > 
> > m1 = rs("Manifest")
> > 
> > m2 = rs("Manifest_wt")
> > 
> > txtShipper.Text = rs("Shipper")
> > 
> > txtConsignee.Text = rs("Consignee")
> > 
> > txtLoad.Text = rs("Loading_port") 
> > 
> > txtDis.Text = rs("Discharge_port")
> > 
> > txtv5.Text = rs("Commenced_dt")
> > 
> > txtV6.Text = rs("Commenced_time")
> > 
> > txtV9.Text = rs("Completed_dt")
> > 
> > txtV10.Text = rs("completed_time") 
> > 
> > txtV7.Text = rs("Sailed_dt")
> > 
> > txtV8.Text = rs("Sailed_time")
> > 
> > txtCFrom.Text = rs("Cargomove_From")
> > 
> > txtCto.Text = rs("Cargomove_To")
> > 
> > st1 = rs("StevOdoreI") 
> > 
> > st2 = rs("SName1")
> > 
> > tt1 = rs("Stevodore_manifest1")
> > 
> > tt2 = rs("Stevodore_manifestwt1")
> > 
> > su1 = rs("StevOdoreII")
> > 
> > su2 = rs("SName2")
> > 
> > tu1 = rs("Stevodore_manifest2")
> > 
> > tu2 = rs("Stevodore_manifestwt2")
> > 
> > 
> > 
> > 
> > 
> > End If
> > 
> > 
> > 
> > ' End If
> > 
> > ' If C1 = "Null" And C2 = "Null" Then
> > 
> > txtAgent.Text = a1 + "-" + a2
> > 
> > txtStev.Text = s1 + "-" + s2
> > 
> > txtCom.Text = C1 + "-" + C2
> > 
> > txtMani.Text = m1 + "&nbdp;" + m2
> > 
> > txtStev1.Text = st1 + "-" + st2 
> > 
> > txtMani1.Text = tt1 + "-" + tt2
> > 
> > txtStev2.Text = su1 + "-" + su2
> > 
> > txtMani2.Text = tu1 + "-" + tu2
> > 
> > ' End If
> > 
> > con.Close()
> > 
> > rs.Close()
> > 
> > End Sub
> > 
> > Please solve this Problem
> > 
> > 
> > 
> > ---------------------------------
> > How much free photo storage do you get? Store your friends n family 
> > photos for FREE with Yahoo! Photos. 
> > http://in.photos.yahoo.com
> > 
> > [Non-text portions of this message have been removed]
> > 
> > 
> >  ------------------------------
> > YAHOO! GROUPS LINKS 
> > 
> > 
> >    - Visit your group 
> > "AspNetAnyQuestionIsOk<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk>"
> >  
> >    on the web.
> >     - To unsubscribe from this group, send an email to:
> >     [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >     - Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> >    Service <http://docs.yahoo.com/info/terms/>.
> > 
> > 
> >  ------------------------------
> > 
> 
> 
> 
> -- 
> Thank you,
> Ryan Olshan
> <asp:WebProgrammer />
> TeraNet Systems
> http://www.teranetsystems.com 




-- 
Thank you,
Ryan Olshan
<asp:WebProgrammer />
TeraNet Systems
http://www.teranetsystems.com


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to