There is something wrong with my code here:
byte[] bits = Convert.ToByte(ds.Tables[0].Rows[0].Item[0]);
There's an error saying that:
System.Data.DataRow does not contain a definition for 'Item'and no extension method 'Item' accepting a first arguement of type 'System.Data.DataRow could be found.
Where did I go wrong?
byte[] bits = Convert.ToByte(ds.Tables[0].Rows[0][0]);
Item is not an indexer, it's a function. You should do:
byte[] bits = Convert.ToByte(ds.Tables[0].Rows[0].Item(0));
Or if you want item at 0,0 position in your table0 you can do:
byte[] bits = Convert.ToByte(ds.Tables[0].Rows[0][0]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With