Click here to Skip to main content
15,907,183 members
Home / Discussions / C#
   

C#

 
Answerhashtable problem Pin
Chetan Patel19-Sep-08 0:43
Chetan Patel19-Sep-08 0:43 
AnswerRe: hashtable problem Pin
Pete O'Hanlon19-Sep-08 2:32
mvePete O'Hanlon19-Sep-08 2:32 
AnswerRe: hashtable problem Pin
Guffa19-Sep-08 2:34
Guffa19-Sep-08 2:34 
QuestionReason for System.StackOverflowException Pin
tauras8119-Sep-08 0:06
tauras8119-Sep-08 0:06 
AnswerRe: Reason for System.StackOverflowException Pin
J4amieC19-Sep-08 0:15
J4amieC19-Sep-08 0:15 
AnswerRe: Reason for System.StackOverflowException Pin
Chetan Patel19-Sep-08 0:46
Chetan Patel19-Sep-08 0:46 
QuestionPrintPageEventHandler issue Pin
laziale18-Sep-08 23:41
laziale18-Sep-08 23:41 
QuestionStoring data in DataTable Pin
Muammar©18-Sep-08 23:12
Muammar©18-Sep-08 23:12 
Good morning good cpiansSmile | :)

DataTable dt = new DataTable("SomeTable");
string[] tokens;

dt.Columns.Add("ID",typeof(int));
dt.Columns.Add("Name",typeof(string));

StreamReader sr = new StreamReader("C:\\SomeFile.csv");

while (!sr.EndOfStream)
{
        tokens = sr.ReadLine().Split(',');
        if (tokens.Length == 2)
            dt.Rows.Add(tokens);

string strExpression = "ID = 1";
DataRow[] dr = dt.Select(strExpression); // <font color="#ee0000">--> Error: Cannot perform '=' operation on System.String and System.Int32.</font>
MessageBox.Show(dr[0].ToString());


I've been posting this since yesterday and I still need it to be as I wrote it "DataTable is filled out of a file that makes it ambiguous to decide what type the value is" as seen from my example, can you please try it with my exact code and tell me what modification I would need?? Cuz I think the problem is in the way I'm storing data not in filtering it!

ps. I should also be able to apply other operands like < and > and concatenate them with variable values.

Many thanks guys!


All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)

AnswerThe other way round Pin
Muammar©19-Sep-08 0:44
Muammar©19-Sep-08 0:44 
AnswerRe: Storing data in DataTable Pin
Chetan Patel19-Sep-08 0:54
Chetan Patel19-Sep-08 0:54 
QuestionHow to get app.config value at .net framework 2.0? Pin
mimimimilaw18-Sep-08 23:00
mimimimilaw18-Sep-08 23:00 
AnswerRe: How to get app.config value at .net framework 2.0? Pin
Giorgi Dalakishvili18-Sep-08 23:02
mentorGiorgi Dalakishvili18-Sep-08 23:02 
GeneralRe: How to get app.config value at .net framework 2.0? Pin
mimimimilaw18-Sep-08 23:34
mimimimilaw18-Sep-08 23:34 
GeneralRe: How to get app.config value at .net framework 2.0? Pin
Giorgi Dalakishvili18-Sep-08 23:40
mentorGiorgi Dalakishvili18-Sep-08 23:40 
QuestionCalendar's NextPrevStyle style dude Pin
Axelaser18-Sep-08 21:43
Axelaser18-Sep-08 21:43 
AnswerRe: Calendar's NextPrevStyle style dude Pin
leppie18-Sep-08 22:48
leppie18-Sep-08 22:48 
Questionquery Pin
lankaudaranga18-Sep-08 21:37
lankaudaranga18-Sep-08 21:37 
AnswerRe: query Pin
Guffa18-Sep-08 21:46
Guffa18-Sep-08 21:46 
AnswerRe: query Pin
Harvey Saayman19-Sep-08 0:29
Harvey Saayman19-Sep-08 0:29 
GeneralRe: query Pin
Ashfield19-Sep-08 1:32
Ashfield19-Sep-08 1:32 
GeneralRe: query Pin
Harvey Saayman19-Sep-08 1:35
Harvey Saayman19-Sep-08 1:35 
GeneralRe: query Pin
Guffa19-Sep-08 2:43
Guffa19-Sep-08 2:43 
GeneralRe: query Pin
Harvey Saayman19-Sep-08 2:46
Harvey Saayman19-Sep-08 2:46 
GeneralRe: query Pin
Ashfield19-Sep-08 2:54
Ashfield19-Sep-08 2:54 
GeneralRe: query Pin
Colin Angus Mackay19-Sep-08 4:52
Colin Angus Mackay19-Sep-08 4:52 

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.