开发者

database.open No intellisense

I'm trying to open a database (using vb) using database.open but there is no Intellisense for this. What do I need to do to open a database? All of the examples I can find show database.open("开发者_StackOverflow中文版ConnectionString") but this option isn't available to me.

I'm with with a fresh ASP.NET Razor application (not MVC) and have a web.config reference to a suitable database.


Are you talking about complete ado.net basics? If you are, check this site out: using ado.net with VB.Net and C#

You actually want to create the object for the sql connection before you open the connection:

Dim sqlConn as new SqlConnection("ConnectionString")
sqlConn.Open()

Also, in your web project, you need to add the reference System.Data (this should add System.Data.SqlClient) and this will need to be imported using

Imports System.Data
Imports System.Data.SqlClient

at the top of the page before the class.

Hope this makes sense.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜