Author: closeguy2005 | Posted on: 7/16/2008 9:04:56 AM | Views : 398

 In the following code I get error "Scalar variable company not defined " ( But it is supposed to be column name ..isn't it ???????)

 so whats wrong? 
 Dim company1 As String
 Dim date1 As Date

 company1 = gvr.Cells(1).Text
 date1 = gvr.Cells(7).Text
 
                Dim Sql As String
                Dim Cmmd As New System.Data.SqlClient.SqlCommand

                Cmmd.Parameters.Add(New SqlParameter("@Company", company1))
                Cmmd.Parameters.Add(New SqlParameter("@Date", date1))

   ...

Go to the complete details ...