compiling error with asp.net 3.5 and not with 2.0

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top