c# - bind grid through different tables -


i have a query. want bind gridview through 2 different tables. tables having no relation, both tables having different named columns.

how can bind gridview. i'd have used joins joines there should (at-least) 1 matching column.

 protected void get_late_arrival() {     string strsql = "select use_id,al_nc,tdate mtbllatearrival tdate=@tdate , al_nc=1 union select user_id,login_date, attendance_status mtblattendance login_date=@login_date , attendance_status=a";     sqlcommand com = new sqlcommand(strsql, con);     com.parameters.add("@tdate", sqldbtype.datetime).value = datetime.now.date;     com.parameters.add("@al_nc", sqldbtype.varchar, 50).value = "1";     com.parameters.add("@login_date", sqldbtype.datetime).value = datetime.now.date;     com.parameters.add("@s", sqldbtype.nvarchar, 10).value = "a";     sqldataadapter sda = new sqldataadapter(com);     datatable dt = new datatable();     sda.fill(dt);     if (dt.rows.count != 0)     {           gridview1.datasource = dt;         gridview1.databind();      }  } 


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -