Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 
Add your own
alternative version
Go to top

Create database in sql server using asp.net with C# (VS2005)

, 5 Oct 2006
Create database in sql server using asp.net with C# (VS2005)
SqlDatabase.zip
SqlDatabase
App_Data
Bin
Interop.SQLDMO.dll
Interop.SQLDMO.dll.refresh
SqlDatabase.suo
Introduction.doc
Picture
MySamples_3x1.jpg
MySamples_2x1.jpg
MySamples_1x1.jpg
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Create Sql Server Database using C#</title>
</head>
<body>
<center>
    <form id="form1" runat="server">
    <div>
        <br />
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="3">
                    <img src="Picture/MySamples_1x1.jpg" id="IMG1" /></td>
            </tr>
            <tr>
                <td colspan="3" style="background-image: url(Picture/MySamples_2x1.jpg); height: 197px">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="width: 100px; height: 178px">
                            </td>
                            <td style="width: 116px; height: 178px">
                                <table border="0" cellpadding="0" cellspacing="1" style="width: 234px">
                                    <tr>
                                        <td align="left" style="font-size: 9pt; width: 106px; font-family: 'Microsoft Sans Serif';
                                            height: 13px">
                                            <asp:Label ID="Label1" runat="server" Text="Server"></asp:Label>
                                            Name</td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px; height: 22px">
                                            <asp:DropDownList ID="cboServers" runat="server" Width="238px">
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td align="left" style="font-size: 9pt; width: 106px; font-family: 'Microsoft Sans Serif';
                                            height: 15px">
                                            Sql user name</td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:TextBox ID="txtUser" runat="server" Width="230px">Sa</asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="left" style="font-size: 9pt; width: 106px; font-family: 'Microsoft Sans Serif';
                                            height: 15px">
                                            sql
                                            Password</td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px; height: 19px">
                                            <asp:TextBox ID="txtPassword" runat="server" Width="230px">IGHO</asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="left" style="font-size: 9pt; width: 106px; font-family: 'Microsoft Sans Serif';
                                            height: 15px">
                                            &nbsp;Database Name</td>
                                    </tr>
                                    <tr>
                                        <td align="left" style="font-size: 9pt; width: 106px; font-family: 'Microsoft Sans Serif';
                                            height: 15px">
                                            <asp:TextBox ID="txt_Database" runat="server" Width="230px">Joshy</asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="font-size: 9pt; width: 106px; font-family: 'Microsoft Sans Serif';
                                            height: 15px">
                                            <asp:Button ID="btnCreateDB" runat="server" Font-Size="Small" 
                                                Text="Create Database" Width="111px" OnClick="btnCreateDB_Click" /></td>
                                    </tr>
                                </table>
                            </td>
                            <td style="height: 178px">
                            </td>
                        </tr>
                    </table>
                    <br />
                </td>
            </tr>
            <tr>
                <td colspan="3" style="background-image: url(Picture/MySamples_3x1.jpg); height: 63px" align="right">
                    &nbsp;
                </td>
            </tr>
        </table>
        <br />
        &nbsp;</div>
    </form>
    </center>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Joshy_geo
Web Developer
India India
I'm Joshy George.I finished my Post Graduation in Computer Application,i'm from the great 'Gods Own Country', Kerala, India. Now I'm working in Infopark Kochin, as a Sr.software Engineer.my specialised areas are C# ,Asp.Net ,Vb6,smart card application,Tapii,Comm ctrls.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 5 Oct 2006
Article Copyright 2006 by Joshy_geo
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid