954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Creating Table using SQL query from wondows Form

Hi Friends!

I stuck somewhere while developing my ERP application on VB.Net

here i require to create a table in SQL Database from my Button Click event, for example ( there are 1 text box and a button on a form, we need to enter the name of a table in that text box and click the button, which should execute a SQL query to create a Table in the Specified Databse)

kindly help me out,

thanking you in anticipation of getting helped

Tech 24X7
Newbie Poster
1 post since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

i thnk u can use this to insert data from textbox into database..if u want some more description -just reply back....
Private Sub LoadData()
Dim strSQL As String = "insert (name,age) values(name_txt.text,age_txt.text)into table21"
Dim cnn As String = ConfigurationSettings.AppSettings("preeconn")
Dim cmd As New SqlCommand(strSQL, New SqlConnection(cnn))
cmd.Connection.Open()
Dim myCommand As New SqlDataAdapter(strSQL, cnn)
Dim ds As New DataSet
myCommand.Fill(ds, "table1")
datagrid1.DataSource = cmd.ExecuteReader

preetham.saroja
Junior Poster in Training
82 posts since Jun 2007
Reputation Points: 5
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You