SQL Connection Error

m_m123

Member
Joined
Mar 11, 2005
Messages
5
Hello
I want to begin a SQL connection with a SQL database in VB.NET(ASP.NET). I used the syntax
<%@ Import namespace="System.Data.Sqlclient" %>
but VB makes an error from the first "%" sign. I wrote the syntax in Button1_Click event. what is the problem. I will be very happy if you can help me
Thank you very much.
 
ASP.Net directives

<%@ ... %> directives must be placed at the top of the .aspx page, not within other code. However, if you are using codebehind - if your Button1_Click event is within a file with extension .aspx.vb - then you do not need this directive. You can simply place Import System.Data.SqlClient at the top of your VB code.

Good luck :cool:
 
Back
Top