Foreach (DataRow Dr In dt. Rows) { String user=Dr (" user "); The string url=Dr (" url "); Question: Dr. "pass" is a binary data, how to put it out? String pass=Dr (" pass "); An error will not object to a string } CodePudding user response:
You directly the tostring ()
try?
CodePudding user response:
reference 1st floor 姎 jacaranda response: you directly the tostring () try? System. Byte [] CodePudding user response:
refer to the second floor isfiefiq response: Quote: refer to 1st floor 姎 jacaranda response: Do you direct the tostring () System. Byte [] https://www.cnblogs.com/spyplus/p/6291751.html Take a look at this try line not line CodePudding user response:
reference 3 floor 姎 jacaranda response: Quote: refer to the second floor isfiefiq response: The Quote: 1/f, reference 姎 jacaranda response: Do you direct the tostring () System. Byte [] https://www.cnblogs.com/spyplus/p/6291751.html Try to see this line not line No, the problem is the datarow is an object, so can't conversion, only the tostring () CodePudding user response:
Foreach (DataRow item in dt. Rows) { If (item) [r]. "pass" GetType ()==typeof (byte [])) { Byte [] bytes=item (" pass ") as byte []; } } CodePudding user response:
Your dt should check to see if there is data, no questions The DataTable dtTest=new DataTable (); DtTest. Columns. The Add (" ID "); DtTest. Rows. The Add (new Object [] {" 1 "}); Foreach (DataRow Dr In dtTest. Rows) { String dd=Dr (" ID "). The ToString (). The Trim (); }