0

I've successfully imported a tab-delimited file into a dataset in asp.net (C#). I can bind the dataset to a gridview, and see my data (that part works fine).

Now I want to insert that dataset table (the only table in the dataset) into a sql table using an INSERT command - I don't know enough about datasets to figure it out.

2
  • 3
    Google it, it's pretty easy to find examples Commented Oct 14, 2015 at 17:16
  • 1
    Make an attempt at the issue! Start by reading the DataSet documentation. Commented Oct 14, 2015 at 17:17

1 Answer 1

0

Actually you won't use the INSERT command, to insert a new table you're going to need this query:

string query = "CREATE TABLE myTable (column1 INT, column2 NVARCHAR(10))"; 

Source: Creating Databases and tables using c#

Where 'column1' is your column's name and INT the type. You can see more about the types here: http://www.w3schools.com/sql/sql_datatypes_general.asp and you can also see more SQL commands here: http://www.w3schools.com/sql/sql_syntax.asp

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.