C#-app: How to call a method which executes an "select"query stmt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ssknov
    New Member
    • Dec 2007
    • 40

    C#-app: How to call a method which executes an "select"query stmt

    hi all

    i need to retrieve the row values from a database thru dataset, for the
    CELL VALUE CLICKED IN DATAGRIDVIEW.

    the datagrid view is already populated from the same table with the single column.
    With that column as Where condition i need to retrieve all its fields.



    thanks in advance
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Kindly post the code that you have tried so far for reference of our experts.

    Comment

    • ssknov
      New Member
      • Dec 2007
      • 40

      #3
      hi
      thanks for ur response,

      when i click the datagridview's cell, immediately i need to pass this cell to a WHERE condition to select the remaining fields of the same row.(ie)the gridcell value is an ID value , remaining fields of the ID should be retrieved to textboxes.

      I wrote code as

      private void DataGrdVw1_Cell ContentClick(ob ject sender, DataGridViewCel lEventArgs e)
      {

      if (dsGridToTxtBx == obj._selectGrid CellAreaDetails (DataGrdVw1.Cur rentCell.Value. ToString()))

      {
      txtAreaName.Tex t = dsGridToTxtBx.T ables[0].Rows[0].ItemArray[1].ToString();
      txtRegion.Text = dsGridToTxtBx.T ables[0].Rows[0].ItemArray[2].ToString();
      txtLocORinterSt .Text = dsGridToTxtBx.T ables [0].Rows[0].ItemArray[3].ToString();
      }
      }

      i had called the _selectGridCell AreaDetails method which retrieves a row to the dataset dsGridToTxtBx.

      hlp me.
      ssk

      Comment

      Working...