Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to determine if my website is down or up using C# Pin
Bert delaVega15-May-08 10:34
Bert delaVega15-May-08 10:34 
QuestionProblem with setting gif images to transparent. Pin
hdv21215-May-08 4:14
hdv21215-May-08 4:14 
QuestionBest way to debug a Windows Service Pin
Christiaan Laubscher15-May-08 2:56
Christiaan Laubscher15-May-08 2:56 
AnswerRe: Best way to debug a Windows Service Pin
dbrenth15-May-08 3:07
dbrenth15-May-08 3:07 
GeneralRe: Best way to debug a Windows Service Pin
Ashfield15-May-08 3:12
Ashfield15-May-08 3:12 
GeneralRe: Best way to debug a Windows Service Pin
Peter Josefsson Sweden16-May-08 12:17
Peter Josefsson Sweden16-May-08 12:17 
AnswerRe: Best way to debug a Windows Service Pin
PIEBALDconsult15-May-08 5:43
mvePIEBALDconsult15-May-08 5:43 
QuestionDataTable / DataRow / someDataTable.Select() Issue Pin
Harvey Saayman15-May-08 2:43
Harvey Saayman15-May-08 2:43 
Hey Guys

i need to filter the data in my DataGridView, when the window opens i query my db and bind the data to a data table and the to the data grid... this works just fine..

now the user must be able so filter these rows, here is my current code...

private void btnSearch_Click(object sender, EventArgs e)
{
    DataTable filterTable = new DataTable();

    string filterString = null;

    string action = cmbAction.SelectedItem.ToString();

    switch(action)
    {
        case"All":
            filterString = "";
            break;

        case"Add":
            filterString = "Action='add'";
            break;

        case"Edit":
            filterString = "Action='edt'";
            break;

        case"Delete":
            filterString = "Action='del'";
            break;
    }

    DataRow[] filteredRowsArray = table.Select(filterString);

    MessageBox.Show("Rows = " + filteredRowsArray.Length);

    if (filteredRowsArray.Length == 0)
    {
        //moan
    }
    else
    {
        filterTable.Clear();
        
        foreach (DataRow newRow in filteredRowsArray)
        {
            filterTable.ImportRow(newRow); //this seems to be the problem...
        }
        dataGridView.DataSource = filterTable;
    }
}



everything is fine up untill i call filterTable.ImportRow(newRow), i think its adding BLANK rows... if i foreach filterTable.Rows the rows are empty Confused | :confused:

i also tried filterTable.Rows.Add(newRow); but then it moans "This row already belongs to another table."

anybody hav some ideas?

Thanx

Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)

AnswerRe: DataTable / DataRow / someDataTable.Select() Issue Pin
Sandeep Kumar15-May-08 3:39
Sandeep Kumar15-May-08 3:39 
GeneralRe: DataTable / DataRow / someDataTable.Select() Issue Pin
Harvey Saayman15-May-08 3:42
Harvey Saayman15-May-08 3:42 
AnswerRe: DataTable / DataRow / someDataTable.Select() Issue Pin
sarvesh.upadhyay15-May-08 5:16
professionalsarvesh.upadhyay15-May-08 5:16 
GeneralRe: DataTable / DataRow / someDataTable.Select() Issue Pin
Harvey Saayman15-May-08 20:00
Harvey Saayman15-May-08 20:00 
QuestionDoEvents() Pin
ellllllllie15-May-08 2:23
ellllllllie15-May-08 2:23 
AnswerRe: DoEvents() Pin
Guffa15-May-08 7:13
Guffa15-May-08 7:13 
QuestionAfterBuild.Bat & PostBuildEvent.bat Pin
Hum Dum15-May-08 2:18
Hum Dum15-May-08 2:18 
QuestionChild processes that is started by a logon process ends when the parent process ends in Windows 2000 Pin
pranu_1315-May-08 1:52
pranu_1315-May-08 1:52 
AnswerRe: Child processes that is started by a logon process ends when the parent process ends in Windows 2000 Pin
Dario Solera15-May-08 2:00
Dario Solera15-May-08 2:00 
Questionlate binding Pin
Pankaj Garg15-May-08 1:52
Pankaj Garg15-May-08 1:52 
AnswerRe: late binding Pin
dan!sh 15-May-08 2:07
professional dan!sh 15-May-08 2:07 
AnswerRe: late binding Pin
CPallini15-May-08 2:10
mveCPallini15-May-08 2:10 
QuestionRe: late binding Pin
Pankaj Garg15-May-08 2:54
Pankaj Garg15-May-08 2:54 
AnswerRe: late binding Pin
CPallini15-May-08 3:11
mveCPallini15-May-08 3:11 
AnswerRe: late binding Pin
Guffa15-May-08 7:29
Guffa15-May-08 7:29 
Questioncould anyone tell me Pin
prasadbuddhika15-May-08 1:18
prasadbuddhika15-May-08 1:18 
AnswerRe: could anyone tell me Pin
Ashfield15-May-08 3:08
Ashfield15-May-08 3:08 

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.