0

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...

Votes + Comments
6
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by sknake
-2

Tell me if this helps.....

<script languae="PHP">
	open_database("location","username","password");
	display_page("PAGE_ID");
	close_database();
</script>
Votes + Comments
php? really?
php for asp.net ?
0

Hi

This is not a recommended solution... it's not a good programming practice... the maintenance would be a big issue as you move in development stage.

Try keep n-tier architecture.
1) keep db as separate with ur scripts
2) Dataaccess layer
3) business layer
4) presentation layer

0

This will create a table named "Test123"

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
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.