J
jk velu
i am executing a query in DataGrid1_itemCOmmend.
Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.
Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
Dim intCount As Integer
Dim cmdvrfy As SqlCommand
cmdvrfy = New SqlCommand("Select * FROM tbl_rating Where DocumentID
=" & DocumentID & "AND ip =" & UserIP & ";", conPubs)
conPubs.Open()
cmdvrfy.Connection = conPubs
cmdvrfy.CommandType = CommandType.Text
intCount = cmdvrfy.ExecuteScalar()
conPubs.Close()
If intCount = 0 Then '127.0.0.1
'Opens the Panel for the user !
Dim MyPanel As Panel
MyPanel = (e.Item.FindControl("Panel1"))
MyPanel.Visible = True
Else
MsgBox("You have already rated this !!!!")
End If
End Sub
But i get this error msg. that is
Line 1: Incorrect syntax near '.0'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect
syntax near '.0'.
Source Error:
Line 82: cmdvrfy.Connection = conPubs
Line 83: cmdvrfy.CommandType = CommandType.Text
Line 84: intCount = cmdvrfy.ExecuteScalar()
Line 85: conPubs.Close()
Line 86: If UserIP = "" Then '127.0.0.1
Source File: c:\inetpub\wwwroot\Rating\star_rating\WebForm1.aspx.vb
HELP me
Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.
Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
Dim intCount As Integer
Dim cmdvrfy As SqlCommand
cmdvrfy = New SqlCommand("Select * FROM tbl_rating Where DocumentID
=" & DocumentID & "AND ip =" & UserIP & ";", conPubs)
conPubs.Open()
cmdvrfy.Connection = conPubs
cmdvrfy.CommandType = CommandType.Text
intCount = cmdvrfy.ExecuteScalar()
conPubs.Close()
If intCount = 0 Then '127.0.0.1
'Opens the Panel for the user !
Dim MyPanel As Panel
MyPanel = (e.Item.FindControl("Panel1"))
MyPanel.Visible = True
Else
MsgBox("You have already rated this !!!!")
End If
End Sub
But i get this error msg. that is
Line 1: Incorrect syntax near '.0'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect
syntax near '.0'.
Source Error:
Line 82: cmdvrfy.Connection = conPubs
Line 83: cmdvrfy.CommandType = CommandType.Text
Line 84: intCount = cmdvrfy.ExecuteScalar()
Line 85: conPubs.Close()
Line 86: If UserIP = "" Then '127.0.0.1
Source File: c:\inetpub\wwwroot\Rating\star_rating\WebForm1.aspx.vb
HELP me