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

serkan sendur commented: boo -1

Recommended Answers

All 5 Replies

Tell me if this helps.....

<script languae="PHP">
	open_database("location","username","password");
	display_page("PAGE_ID");
	close_database();
</script>
commented: php for asp.net ? -1
commented: php? really? +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

hi it's me again...i was little curious about u r sql server version...? is it 2000/2005/2008?

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.