D
David
Hi,
Thsi code below works perfect under asp.net 2.0. Now, i installed asp.net
3.5 and i get an weird error. Even when i change the build version back to
2.0, the error remains. When i test this code with Cassini in VWD 2008, i
don't get that error.
I use a public shared sub into a class for performing an insert into a table
of the database.
I get following error:
BC30451: Name 'consql' is not declared
at line: consql.insert_rec(ddl1)
Thanks for help
David
class:
-----
Public Class consql
Public Shared Sub insert_rec(ByVal ddl1 As String)
Try
Using mConnection As New SqlConnection(param.ConnectionString)
Dim mCommand As SqlCommand = New SqlCommand("sauverec",
mConnection)
mCommand.CommandType = CommandType.StoredProcedure
mCommand.Parameters.AddWithValue("@ddl1", ddl1)
mConnection.Open()
mCommand.ExecuteNonQuery()
mConnection.Close()
mCommand.Dispose()
End Using
Catch ex As Exception
Throw
End Try
End Sub
End Class
code-behind:
------------
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim ddl1 As String
ddl1="ok"
consql.insert_rec(ddl1)
End Sub
Thsi code below works perfect under asp.net 2.0. Now, i installed asp.net
3.5 and i get an weird error. Even when i change the build version back to
2.0, the error remains. When i test this code with Cassini in VWD 2008, i
don't get that error.
I use a public shared sub into a class for performing an insert into a table
of the database.
I get following error:
BC30451: Name 'consql' is not declared
at line: consql.insert_rec(ddl1)
Thanks for help
David
class:
-----
Public Class consql
Public Shared Sub insert_rec(ByVal ddl1 As String)
Try
Using mConnection As New SqlConnection(param.ConnectionString)
Dim mCommand As SqlCommand = New SqlCommand("sauverec",
mConnection)
mCommand.CommandType = CommandType.StoredProcedure
mCommand.Parameters.AddWithValue("@ddl1", ddl1)
mConnection.Open()
mCommand.ExecuteNonQuery()
mConnection.Close()
mCommand.Dispose()
End Using
Catch ex As Exception
Throw
End Try
End Sub
End Class
code-behind:
------------
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim ddl1 As String
ddl1="ok"
consql.insert_rec(ddl1)
End Sub