|
-
May 10th, 2005, 06:02 AM
#1
Thread Starter
Addicted Member
[RESOLVED] System Generate Error Message Specify Cast Is Not Valid
System Generate Error Message Specify Cast Is Not Valid
public int EditGrid(DataGrid myGrid, string myValue)
{
DataTable myTable= null;
myTable= (DataTable)myGrid.DataSource;
}
Last edited by Waseemalisyed; May 23rd, 2005 at 11:58 PM.
-
May 10th, 2005, 08:16 AM
#2
Member
Re: System Generate Error Message Specify Cast Is Not Valid
You are trying to put a datasource into a table object => that's a big no no 
And by trying to convert the datasource to a table object ...., no that is not the way cause simply a datasource isn't a table object.
If I'm not mistaken it my work like this : myTabel = myDs.Tables[int index];
and myDs is the datasource of your datagrid
-
May 11th, 2005, 12:55 AM
#3
Thread Starter
Addicted Member
Re: System Generate Error Message Specify Cast Is Not Valid
but we can do this in vb.net
myTable = CType(myGrid.DataSource, DataTable)
-
May 11th, 2005, 01:06 AM
#4
Member
Re: System Generate Error Message Specify Cast Is Not Valid
could be but this is C#.
Just get the datasource of your datagrid and then get the table from the datasource
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|