see my code

  • Thread starter Thread starter muhammadanzar
  • Start date Start date
M

muhammadanzar

Guest
hi

see my code OF VB.NET, the portion in "IF IsDBNull(table(0)(0) = 0.0) THEN" IS NOT EXECUTED ELSE PORTION EXECUTED, CAN YOU GUIDE ME. DURING

DEBUG TABLE(0)(0) VALUE IS 0D. BALANCE DATATYPE IS MONEY IN SQL SERVER.

Using connection As New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True")
Dim str1 As String
str1 = "select top 1 Balance FROM dbo.PaymentReceived where dbo.PaymentReceived.CustomerName ='" + TextBox2.Text + "' order by ReceivedDate desc"

Using adapter As New SqlDataAdapter(str1, connection)
Using table As New DataTable()
Try
adapter.Fill(table)
If IsDBNull(table(0)(0) = 0.0) Then
str1 = "select SUM(receiveable)from PaymentReceived where Balance = 0.0 and dbo.PaymentReceived.CustomerName ='anzar'"
Using adapter1 As New SqlDataAdapter(str1, connection)
Using table1 As New DataTable()
TextBox5.Text = table1(0)(0)
Label11.Text = table(0)(0)
Label13.Text = Label11.Text
End Using
End Using

Else 'case 2
TextBox5.Text = table(0)(0)
Label11.Text = table(0)(0)
Label13.Text = Label11.Text '- Label12.Text
' TextBox8.Text = Label11.Text - TextBox6.Text

End If

Catch ex As Exception
MsgBox(ex.Message)
Finally
End Try
End Using
End Using
End Using
THANKS



MUHAMMAD ANZAR E-mail : muhammadanzar@hotmail.com Mobile # :0092-3215096959

Continue reading...
 
Back
Top