m_m123 Posted December 3, 2006 Posted December 3, 2006 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. Quote
MrPaul Posted December 3, 2006 Posted December 3, 2006 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: Quote Never trouble another for what you can do for yourself.
m_m123 Posted December 3, 2006 Author Posted December 3, 2006 Tnx Thanks alot for your attention.It seems that it's working correctly. :) Best Wishes Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.