Click here to Skip to main content
16,004,977 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDatatables Pin
chohanpk21-Jan-07 20:36
chohanpk21-Jan-07 20:36 
AnswerRe: Datatables Pin
Jon Sagara21-Jan-07 20:43
Jon Sagara21-Jan-07 20:43 
GeneralRe: Datatables Pin
chohanpk21-Jan-07 20:46
chohanpk21-Jan-07 20:46 
GeneralRe: Datatables Pin
enjoycrack21-Jan-07 20:55
enjoycrack21-Jan-07 20:55 
GeneralRe: Datatables Pin
chohanpk21-Jan-07 21:01
chohanpk21-Jan-07 21:01 
GeneralRe: Datatables Pin
enjoycrack21-Jan-07 21:15
enjoycrack21-Jan-07 21:15 
GeneralRe: Datatables Pin
Christian Graus21-Jan-07 21:50
protectorChristian Graus21-Jan-07 21:50 
GeneralRe: Datatables Pin
chohanpk21-Jan-07 22:22
chohanpk21-Jan-07 22:22 
here is code:

DataTable dt = new DataTable("tblcheck");

DataColumn dc1 = new DataColumn("col1", typeof(int));
dt.Columns.Add(dc1);

DataColumn dc2 = new DataColumn("col2", typeof(int));
dt.Columns.Add(dc2);
DataSet ds = new DataSet();
ds.Tables.Add(dt);

DataRow dr1 = dt.NewRow();
dr1["col1"] = 1;
dr1["col2"] = 2;
dt.Rows.Add(dr1);


//SqlDataAdapter adp2 = new SqlDataAdapter("select col1 from dt", con);
//adp2.Fill(ds, "dt");
GridView1.DataSource = ds;
GridView1.DataBind();




if i dont nclude these rows,
"SqlDataAdapter adp2 = new SqlDataAdapter("select col1 from dt", con);
adp2.Fill(ds, "dt");"

then it shows values.
but with these dataadapter code it gives error.i want to use dataadpater to fill the dataset.what will be the solution?



Chohan

GeneralRe: Datatables Pin
Christian Graus21-Jan-07 22:35
protectorChristian Graus21-Jan-07 22:35 
GeneralRe: Datatables Pin
chohanpk21-Jan-07 22:39
chohanpk21-Jan-07 22:39 
GeneralRe: Datatables Pin
Christian Graus21-Jan-07 22:44
protectorChristian Graus21-Jan-07 22:44 
GeneralRe: Datatables Pin
chohanpk21-Jan-07 22:52
chohanpk21-Jan-07 22:52 
GeneralRe: Datatables Pin
Christian Graus21-Jan-07 23:04
protectorChristian Graus21-Jan-07 23:04 
GeneralRe: Datatables Pin
chohanpk22-Jan-07 0:22
chohanpk22-Jan-07 0:22 
GeneralRe: Datatables Pin
Christian Graus22-Jan-07 0:27
protectorChristian Graus22-Jan-07 0:27 
GeneralRe: Datatables Pin
chohanpk22-Jan-07 0:46
chohanpk22-Jan-07 0:46 
GeneralRe: Datatables Pin
Christian Graus22-Jan-07 1:06
protectorChristian Graus22-Jan-07 1:06 
QuestionHow to sort gridview in c#.Net Pin
aaraaayen21-Jan-07 20:32
aaraaayen21-Jan-07 20:32 
JokeRe: How to sort gridview in c#.Net Pin
enjoycrack21-Jan-07 20:48
enjoycrack21-Jan-07 20:48 
AnswerRe: How to sort gridview in c#.Net Pin
enjoycrack21-Jan-07 20:53
enjoycrack21-Jan-07 20:53 
GeneralRe: How to sort gridview in c#.Net Pin
aaraaayen21-Jan-07 23:07
aaraaayen21-Jan-07 23:07 
QuestionUserControl Pin
AnhTin21-Jan-07 20:31
AnhTin21-Jan-07 20:31 
AnswerRe: UserControl Pin
enjoycrack21-Jan-07 20:41
enjoycrack21-Jan-07 20:41 
QuestionFailed to read a folder Pin
nclauder21-Jan-07 20:27
nclauder21-Jan-07 20:27 
AnswerRe: Failed to read a folder Pin
enjoycrack21-Jan-07 20:35
enjoycrack21-Jan-07 20:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.