|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
web.config中的文件如下: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="constring" value="integrated security=SSPI;data source=localhost;initial catalog=教务治理系统" /> </appSettings> <system.web> 。。。。。。。。。 </system.web> </configuration> 访问如下: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load \\\'在此处放置初始化页的用户代码 If Not IsPostBack Then Dim str As String = ConfigurationSettings.AppSettings("constring") Dim con As New SqlClient.SqlConnection(str) da.SelectCommand.Connection = con da.Fill(daset, "课程信息") dagrid.DataSource = daset.Tables("课程信息") dagrid.DataBind() End If End Sub 返回类别: 教程 上一教程: COM组件中如何连接数据库 下一教程: VBS类生成XML文件 您可以阅读与"在WEB.CONFIG中添加连接字符串"相关的教程: · 连接数据库常用的连接字符串 · 转变字符串带有HTTP://的超级链接字符串为真正的超级链接 · 转变字符串带有HTTP://的超级链接字符串为真正的超级链接(源码) · ADO连接数据库字符串大全 · 用函数简化你的字符串连接语句 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |