| | |
Connect to SQL
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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 "
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv gridview gudi iis javascript list listbox login menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers






