3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by __avd
0
<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs) ' or button click event
    If Not IsPostBack Then
        Dim DBConn as SQLConnection
        Dim DBCommand As SQLDataAdapter
        
       
       DBConn = New SQLConnection("server=localhost;" _
            & "Initial Catalog=TT;" _
           & "User Id=sa;" _
           & "Password=yourpassword;")
        
        DBCommand = New SQLDataAdapter( _
            "create table employee(empid int, empname varchar(20), salary int);")
                              
       
    End If
End Sub
0

>i find it difficult to add mssql dbs to asp.net website when i am using vs2008.

Steps:

1. Create/open a "WebSite"
2. Select WebSite menu
3. Select Add New Item
4. SQl Server Database (.mdf)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.