0

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

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by preetham.saroja
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

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.