|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using sqlDataAdapter to fill DatasetI am setting my adapter to the below value and then filling the dataset and
binding the data grid to that after I set my dataset equal to the datagrid's datasource. I manual bind the fields of the query to the datagrid. Can I set my sqlDataAdapter like this. It's choking on B.QSTN fields but finds the first three. I SQL statement below works fine in my query analyzer. SELECT A.PRSN_ID, A.LOGIN_NAME, A.ANSWER, B.QSTN, C.DESCR FROM tblCFSPH_CM_LOGIN A INNER JOIN tblCFSPH_CM_PRSN_ROLE_LINK D ON A.PRSN_ID = D.PRSN_ID INNER JOIN tblCFSPH_CM_ROLE C ON D.ROLE_ID = C.ROLE_ID LEFT JOIN tblCFSPH_SECRT_QSTN B ON A.QSTN_ID = B.QSTN_ID Thanks! Hi Andy,
If you only want to bind the first three fields in the query to the datagrid, that's OK. Set datagrid's AutoGenerateColumns to False and set three BoundColumns in the datagrid like: <Columns> <asp:BoundColumn DataField="PRSN_ID" HeaderText="ID"> </asp:BoundColumn> <asp:BoundColumn DataField="LOGIN_NAME" HeaderText="Name"> </asp:BoundColumn> <asp:BoundColumn DataField="ANSWER" HeaderText="Answer"> </asp:BoundColumn> </Columns> That will only bind three field in the datagrid. Hope it helps, Elton Wang elton_w***@hotmail.com >-----Original Message----- filling the dataset and>I am setting my adapter to the below value and then >binding the data grid to that after I set my dataset equal to the datagrid's>datasource. I manual bind the fields of the query to the datagrid. Can I>set my sqlDataAdapter like this. It's choking on B.QSTN fields but finds>the first three. I SQL statement below works fine in my D ON A.PRSN_ID =query analyzer. > >SELECT A.PRSN_ID, A.LOGIN_NAME, A.ANSWER, B.QSTN, C.DESCR FROM >tblCFSPH_CM_LOGIN A INNER JOIN tblCFSPH_CM_PRSN_ROLE_LINK >D.PRSN_ID INNER JOIN tblCFSPH_CM_ROLE C ON D.ROLE_ID = C.ROLE_ID LEFT JOINShow quoteHide quote >tblCFSPH_SECRT_QSTN B ON A.QSTN_ID = B.QSTN_ID > >Thanks! > > >. >
multiple Rowfiltering and binding the changes to the datagrid
Casting a grid Refresh problem How to Make Calculator in ASP and Cold fusion Paging for DataList Control auto postback(urgent!) selecting a DataGridRow wipes out the selected row's text Suggestion Can You Change Colors on GridLines? error in getting textbox value in EditCommand |
|||||||||||||||||||||||