944,214 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 4635
  • VB.NET RSS
Aug 31st, 2007
0

Creating Table using SQL query from wondows Form

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tech 24X7 is offline Offline
1 posts
since Aug 2007
Aug 31st, 2007
0

Re: Creating Table using SQL query from wondows Form

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
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
preetham.saroja is offline Offline
82 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: importing data from excel to comboBox
Next Thread in VB.NET Forum Timeline: How?????????





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC