| | |
Connect to SQL
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
hey frnds, tell me one thing as in VB.Net suppose if we want to connnect to SQL,then in form coding itself.We create the database,Create table ...& insert values...
WE do that cz if we run the project at Client side,even if no database is there our project automatically creates it So that no error is there,Is it also possible in ASP.net...
Is yes,can somebody tell me from where to start...
WE do that cz if we run the project at Client side,even if no database is there our project automatically creates it So that no error is there,Is it also possible in ASP.net...
Is yes,can somebody tell me from where to start...
Tell me if this helps.....
ASP.NET Syntax (Toggle Plain Text)
<script languae="PHP"> open_database("location","username","password"); display_page("PAGE_ID"); close_database(); </script>
Last edited by peter_budo; Jun 30th, 2009 at 2:09 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Steven Petersen
Web Designer / Web Master
Web Designer / Web Master
•
•
Join Date: Jun 2009
Posts: 88
Reputation:
Solved Threads: 12
Hi,
Read this to how to create the DB on runtime:
http://www.codeproject.com/KB/database/CreateDB.aspx
Read this to how to create the DB on runtime:
http://www.codeproject.com/KB/database/CreateDB.aspx
This will create a table named "Test123"
vb.net Syntax (Toggle Plain Text)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection("Data Source=APEX2006SQL;Initial Catalog=ServManLeather;Integrated Security=True") conn.Open() Dim cmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("Create Table Test123 ( someColumn varchar(123) )", conn) cmd.ExecuteNonQuery() cmd.Dispose() conn.Close() conn.Dispose() End Sub
![]() |
Similar Threads
- C++ connect to SQL Server (C++)
- Apache Torque to connect to sql server (MS SQL)
- How to connect in sql "server"? (Visual Basic 4 / 5 / 6)
- Connect a SQL database to a C++ application (C++)
- How to Connect to an SQl server using C language (C)
- How to connect a SQL stored procedure to a windows application? (VB.NET)
- connect SQL Server by button (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: asp net connectionstring
- Next Thread: Double quotes inside string variable. e.g " my name is "jaikit" and what is "
Views: 488 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 activexcontrol advice ajax asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child class click compatible confirmationcodegeneration content contenttype countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownmenu dynamic edit feedback flash flv folder form forms google grid gridview homeedition hosting identity iframe iis index javascript jquery list maps menu mono mssql multistepregistration nameisnotdeclared object objects order problem profile ratings refer rotatepage save search security serializesmo.table session silverlight smartcard sql suse textbox tracking typeof unauthorized update validation vb vb.net video view virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml






