473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

bind data to gridview

Hello everybody,

PLease help me to bind the data from datasource to a dridview, here is my command

Expand|Select|Wrap|Line Numbers
  1.  OracleDataAdapter adTarget = new OracleDataAdapter
  2.                ("SELECT  B.DMAIC_DESC DMAICDESC ,a.TARGET_MONTH    MONTH , a.TARGET_YEAR YEAR FROM SIXSIGMA_USER.DMAIC_TARGET A, SIXSIGMA_USER.DMAIC B WHERE a.PROJECT_ID = '" + DropDownListProject.SelectedValue + "'  AND A.DMAIC_CODE = B.DMAIC_ID ", Conn);
  3.  
  4.  
  5.         DataSet dsTarget = new DataSet();
  6.         adTarget.Fill(dsTarget);
  7.         GridViewTarget.DataSource = dsTarget.Tables[0];
  8.         GridViewTarget.DataBind();
I cant bind it to gridview, while when my select Command is from a one table, this code works, like the code below

Expand|Select|Wrap|Line Numbers
  1. OracleDataAdapter adTarget = new OracleDataAdapter
  2.                ("SELECT  *    FROM SIXSIGMA_USER.DMAIC_TARGET  WHERE PROJECT_ID = '" + DropDownListProject.SelectedValue + "'  ", Conn);
  3.  
  4.  
  5.         DataSet dsTarget = new DataSet();
  6.         adTarget.Fill(dsTarget);
  7.         GridViewTarget.DataSource = dsTarget.Tables[0];
  8.         GridViewTarget.DataBind();
Thanks in advance
Dec 11 '07 #1
2 1618
kenobewan
4,871 Expert 4TB
So the problem is with your select query?
Dec 11 '07 #2
debasisdas
8,127 Expert 4TB
You are unable to bind to the grid
or
unable to retrive the desired data from database ?
Dec 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: COHENMARVIN | last post by:
I'm leafing through a big book on asp.net, and I don't see any way to the following: 1. bind values and text to a dropdown 2. Also make the first line of the dropdown say something different. For...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView on an Aspx page. I need my GridView to have three columns: Name , City and Photo I want to declare the data in my Aspx.Vb code and bind it to my GridView. I...
4
by: Dabbler | last post by:
I have two tables I'm editing in a Gridview. The VANS table contains a key to the other LESSOR table. I would like to use a dropdown list to select the LessorId value while displaying the Lessor...
0
by: teclioness | last post by:
Hi, I am using gridview for the user to update rows. In a row, there sre two columns, which need to be updated. When the gridview is to be shown, the row should show the values from database....
0
by: wardemon | last post by:
Hi All, I was just wondering if the following is possible? To bind a GridView's datasource to the Repeater's current DataRow value. I tried creating a dataset, then load the datarowview inside...
0
by: GMartin | last post by:
I have a pop-up form with a three columned Grid that has checkboxes in a Template Column in the first/left-most column. (The form is to allow users to select "Members" of a group, where they check...
1
by: weird0 | last post by:
I have created a GridView and dynamically added data to it by creating a DataTable(as advised) and bound it with a reader. Then, assigned the DataSource of GridView to DataTable. But even that aint...
3
by: Steve Kershaw | last post by:
Hi, I need a way to bind a DirectoryInfo array to a GridView without any errors. The code I'm using to create the DirectoryInfo array is: // Define the current directory DirectoryInfo dir...
1
by: dhamo | last post by:
How to bind checkbox with gridview in asp.net 2.0 I take a gridview control and bind data dynamicaly using code.I taken backend tool as a Ms Access and now I want to add new column with checkbox...
1
by: jaredciagar | last post by:
Hi guys...can you help me please.... I'm using ASP.net, MSSQL 2005 and VB Script I have don't know how to bind data in gridview control from database. I want also to allow paging in gridview...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.