| | |
Creating Table using SQL query from wondows Form
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 1
Reputation:
Solved Threads: 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
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
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
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
![]() |
Similar Threads
- how to delete duplicate record in a table by using SQL query (MS SQL)
- database driven login page (ASP.NET)
- retrieving a particular value with a sql query (PHP)
- C# VS 2005 - SQL Query Parameters to an ODBC DataSource (C#)
- sql query updating problem (Visual Basic 4 / 5 / 6)
- Retreiving variables from a sql query into a form (PHP)
Other Threads in the VB.NET Forum
- Previous Thread: importing data from excel to comboBox
- Next Thread: How?????????
| Thread Tools | Search this Thread |
.net .net2008 2008 access advanced application array basic beginner browser button buttons center click client code combo convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel exists fade filter forms function generatetags html images input intel internet listview map mobile module monitor msaccess net number objects open panel pdf picturebox picturebox2 port position print printing problem read regex remove right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol vb vb.net vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms winsock wpf wrapingcode xml year





