Click here to Skip to main content
16,005,281 members
Home / Discussions / C#
   

C#

 
Questiondot confusion Pin
netJP12L10-May-07 4:50
netJP12L10-May-07 4:50 
AnswerRe: dot confusion Pin
Ravi Bhavnani10-May-07 5:20
professionalRavi Bhavnani10-May-07 5:20 
GeneralRe: dot confusion Pin
netJP12L10-May-07 5:46
netJP12L10-May-07 5:46 
GeneralRe: dot confusion Pin
Scott Dorman10-May-07 11:40
professionalScott Dorman10-May-07 11:40 
QuestionCommunicating with a windows service. Pin
teejayem10-May-07 4:34
teejayem10-May-07 4:34 
QuestionWriting in a Xml Pin
Anka_Ame10-May-07 4:34
Anka_Ame10-May-07 4:34 
AnswerRe: Writing in a Xml Pin
led mike10-May-07 5:14
led mike10-May-07 5:14 
QuestionCan I get the data in a specific Column/Cell instead of the entire data in the Row? [modified] Pin
Khoramdin10-May-07 4:32
Khoramdin10-May-07 4:32 
Hello everyone,

I am using a DataGridView control to display data which is stored in a remote database server. Using filter, I am trying to get the rows of information that I am looking for in the dataset. I was wondering if it is possible to get the data in a specific column/cell rather than the entire data in the row?

The following is the code that I am using for filtering the data in the DataGridView control.

string strText;<br />
        string strExpr;<br />
        string strSort;<br />
        DataRow[] foundRows;<br />
        //      DataTable myTable;<br />
        //      myTable = ds.Tables["Orders"];      <br />
        //      myTable = myds.Tables[SelectedTableName];<br />
<br />
        // Setup Filter and Sort Criteria<br />
        strExpr = "shop_id >= '4' AND shop_id <= '7'";<br />
        //strSort = "shop_id DESC";<br />
        strSort = "shop_id ASC";<br />
<br />
        // Use the Select method to find all rows matching the filter.<br />
        foundRows = myTable.Select(strExpr, strSort);<br />
<br />
        // Apply all Columns to the TextBox, this<br />
        // must be done Row-By-Row.<br />
        strText = null;<br />
        for (int i = 0; i <= foundRows.GetUpperBound(0); i++)<br />
        {<br />
            for (int j = 0; j <= foundRows[i].ItemArray.GetUpperBound(0); j++)<br />
            {<br />
                strText = strText + foundRows[i][j].ToString() + "\t";<br />
            }<br />
            strText = strText + "\r\n";<br />
            textBox.Text = strText;<br />
        }


Thank you very much and have a great day.

Khoramdin



-- modified at 11:03 Thursday 10th May, 2007
AnswerRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
led mike10-May-07 5:10
led mike10-May-07 5:10 
GeneralRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
Khoramdin10-May-07 6:13
Khoramdin10-May-07 6:13 
GeneralRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
led mike10-May-07 6:31
led mike10-May-07 6:31 
GeneralRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
Khoramdin10-May-07 12:59
Khoramdin10-May-07 12:59 
QuestionSetWindowPos fails Pin
Stevo Z10-May-07 4:01
Stevo Z10-May-07 4:01 
AnswerRe: SetWindowPos fails Pin
Judah Gabriel Himango10-May-07 5:07
sponsorJudah Gabriel Himango10-May-07 5:07 
GeneralRe: SetWindowPos fails Pin
Stevo Z10-May-07 5:26
Stevo Z10-May-07 5:26 
AnswerRe: SetWindowPos fails Pin
Giorgi Dalakishvili10-May-07 11:39
mentorGiorgi Dalakishvili10-May-07 11:39 
GeneralRe: SetWindowPos fails Pin
Stevo Z10-May-07 21:25
Stevo Z10-May-07 21:25 
Questionhow to compare two dates excluding the seconds. Pin
Exelioindia10-May-07 3:37
Exelioindia10-May-07 3:37 
AnswerRe: how to compare two dates excluding the seconds. Pin
Colin Angus Mackay10-May-07 3:48
Colin Angus Mackay10-May-07 3:48 
QuestionAuto-hyperlinking URLs Pin
__DanC__10-May-07 3:24
__DanC__10-May-07 3:24 
AnswerRe: Auto-hyperlinking URLs Pin
Stevo Z10-May-07 4:33
Stevo Z10-May-07 4:33 
GeneralRe: Auto-hyperlinking URLs Pin
__DanC__10-May-07 6:00
__DanC__10-May-07 6:00 
QuestionQuery Pin
vasavi.polisetty10-May-07 3:16
vasavi.polisetty10-May-07 3:16 
AnswerRe: Query Pin
Arun.Immanuel10-May-07 3:18
Arun.Immanuel10-May-07 3:18 
AnswerRe: Query Pin
__DanC__10-May-07 3:25
__DanC__10-May-07 3:25 

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.