m developing one application in 3 tier architecture,
but i can select records from database in same architecture but unable to create table?
How to create tabel in 3 tier architecture in c#
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 21, 2013, 11:48 PM EST
hi,
normally following code may help you to create table from C# code
SqlConnection con = new SqlConnection("Data Source=.\sqlexpress;user id=sa;password=test1!;Initial Catalog=TempDBfortesting;MultipleActiveResultSets=True");
SqlCommand command = new SqlCommand();
command.CommandType = CommandType.Text;
command.CommandText = "Create table testTable(Id int,name varchar(50))";
command.Connection = con;
con.Open();
int res = command.ExecuteNonQuery();
con.Close();
if you use same code still you can any error, please share errror as well as you Piece of code
hope this will help you.