在本地数据库中创建连接 [英] create connection in local database

查看:85
本文介绍了在本地数据库中创建连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在vb.net中创建本地数据库.但是我收到了错误消息.
我的代码就是这样
导入System.Data.SqlClient
导入System.Windows.Forms.Binding

公共课程表格1
继承System.Windows.Forms.Form
将Dim ds用作新数据集
昏暗为新的SqlDataAdapter
" Dim DBcon AS New Sqlconnection(数据源=.\ Initial_Catalog = Esaymarks;"&集成安全性= true;异步处理= true)
私有DBConn作为新的SqlConnection(数据源=.\ SQLEXPRESS; AttachDbFilename =" C:\ Users \ Amal \ Documents \ Visual Studio 2008 \ Projects \ WindowsApplication11 \ WindowsApplication11 \ Database1.mdf;集成安全性= True;用户实例= True )
私有子Form1_Load(ByVal发送者作为System.Object,ByVal e作为System.EventArgs)处理MyBase.Load

结束子
但是此行中的错误
数据源=.\ SQLEXPRESS; AttachDbFilename ="C
请更正此
感谢

解决方案

错误消息是什么?无论如何都要检查
http://www.connectionstrings.com/ [ ^ ]


im try to create local database in vb.net. but i got error msg.
my code is like that
Imports System.Data.SqlClient
Imports System.Windows.Forms.Binding

Public Class Form1
Inherits System.Windows.Forms.Form
Dim ds As New DataSet
Dim da As New SqlDataAdapter
''Dim DBcon AS New Sqlconnection("Data Source=.\Initial_Catalog=Esaymarks;"& Integrated Security=true;asynchronous proccessing=true")
Private DBConn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Users\Amal\Documents\Visual Studio 2008\Projects\WindowsApplication11\WindowsApplication11\Database1.mdf";Integrated Security=True;User Instance=True")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
but error in this line
Data Source=.\SQLEXPRESS;AttachDbFilename="C
please correct this
thanks

解决方案

What''s the error message? Anyway check it
http://www.connectionstrings.com/[^]


这篇关于在本地数据库中创建连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆