Creating Table using SQL query from wondows Form

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 1
Reputation: Tech 24X7 is an unknown quantity at this point 
Solved Threads: 0
Tech 24X7 Tech 24X7 is offline Offline
Newbie Poster

Creating Table using SQL query from wondows Form

 
0
  #1
Aug 31st, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: Creating Table using SQL query from wondows Form

 
0
  #2
Aug 31st, 2007
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC