I am using VS 2005 + SQL Server 2000.
The piece of code is as follows
Public Function GetAppId(ByRef AN As String) As String Dim scon As New System.Data.SqlClient.SqlConnection ‘ declare the connection scon.ConnectionString = ConfigurationManager.ConnectionStrings("strSimCon").ToString ‘ strSimCon is connection ‘ ‘string stored in web.config file scon.Open()’ opening of connection Dim querystring As String = "Select AppCode From ApplicationData Where AppName=" & AN ‘ AN is the ‘ string which will contain Name of The application. On the basis of this name a unique ID will be retrieved. Dim myCommand As New System.Data.SqlClient.SqlCommand(querystring, scon) Dim sreader As System.Data.SqlClient.SqlDataReader * sreader = myCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)’ I have tried using no option or all other options .But no result. GetAppId = sreader.GetString(0) Return GetAppId
End Function
I am getting an error (exception) as
System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'Calculation'.
Can anyone guide me what is not correct?
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).