Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralRe: SFTP, Tamir Pin
GeorgeBerry14-Aug-07 1:13
GeorgeBerry14-Aug-07 1:13 
QuestionData Grid problem Pin
Janu_M13-Aug-07 0:14
Janu_M13-Aug-07 0:14 
Hi I am developing a windows application (VS 2003) in which it contains some buttins and a grid. The Grid has to show all the data from a csv file, for this i am reading all the data from csv file into datatable and giving that datatable as a datasource to data grid.

dtTable = new DataTable();
dtTable.Columns.Add("Name");
dtTable.Columns.Add("Time1");
dtTable.Columns.Add("Time2");
dtTable.Columns.Add("Path");
dtTable.Columns.Add("IconName");
dtTable.AcceptChanges();

if(File.Exists(Application.StartupPath + "\\Recordings.csv"))
{
StreamReader sreader = new StreamReader(Application.StartupPath + "\\File.csv");
string strval = sreader.ReadLine();
while (strval != null)
{
DataRow row1 = dtTable.NewRow();
string[] str = strval.Split(',');
for(int i = 0; i < str.Length; i++)
{
row1[i] = str[i];
}
dtTable.Rows.Add(row1);
strval = sreader.ReadLine();
}
dtTable.AcceptChanges();
sreader.Close();
// }
dtGrid.DataSource = dtTable;
dtGrid.Refresh();

I am using the above code for showing the contents of file to Grid.

if user clicks start button on the form, after completing the action i want to add a row to grid. For this i am writing the new row to the CSV file and calling the above code.

But it is giving error: "Controls created on one thread cannot be parented to a control on a different thread."

Any one please help me.
Thanks in Advance
AnswerRe: Data Grid problem Pin
Christian Graus13-Aug-07 0:28
protectorChristian Graus13-Aug-07 0:28 
GeneralRe: Data Grid problem Pin
blakey40413-Aug-07 3:30
blakey40413-Aug-07 3:30 
GeneralRe: Data Grid problem Pin
Janu_M14-Aug-07 1:21
Janu_M14-Aug-07 1:21 
Questionhow to change connection string of crystal report. Pin
monuSaini13-Aug-07 0:06
monuSaini13-Aug-07 0:06 
AnswerRe: how to change connection string of crystal report. Pin
Colin Angus Mackay13-Aug-07 0:34
Colin Angus Mackay13-Aug-07 0:34 
GeneralRe: how to change connection string of crystal report. Pin
monuSaini13-Aug-07 0:56
monuSaini13-Aug-07 0:56 
GeneralRe: how to change connection string of crystal report. Pin
sathish s13-Aug-07 2:31
sathish s13-Aug-07 2:31 
GeneralRe: how to change connection string of crystal report. Pin
Colin Angus Mackay13-Aug-07 2:46
Colin Angus Mackay13-Aug-07 2:46 
Questioncombo box Pin
costavo12-Aug-07 23:19
costavo12-Aug-07 23:19 
AnswerRe: combo box Pin
Keith Barrow12-Aug-07 23:35
professionalKeith Barrow12-Aug-07 23:35 
AnswerRe: combo box Pin
Michael Sync12-Aug-07 23:38
Michael Sync12-Aug-07 23:38 
GeneralRe: combo box Pin
Michael Sync12-Aug-07 23:40
Michael Sync12-Aug-07 23:40 
AnswerRe: combo box Pin
Nouman Bhatti12-Aug-07 23:56
Nouman Bhatti12-Aug-07 23:56 
GeneralRe: combo box Pin
costavo13-Aug-07 0:02
costavo13-Aug-07 0:02 
GeneralRe: combo box Pin
Michael Sync13-Aug-07 16:49
Michael Sync13-Aug-07 16:49 
QuestionWPF Top level exception handling problem Pin
Keith Barrow12-Aug-07 23:09
professionalKeith Barrow12-Aug-07 23:09 
QuestionC# directX how to getit up? Pin
mercenary0112-Aug-07 22:58
mercenary0112-Aug-07 22:58 
AnswerRe: C# directX how to getit up? Pin
stancrm12-Aug-07 23:09
stancrm12-Aug-07 23:09 
AnswerRe: C# directX how to getit up? Pin
Talal Sultan12-Aug-07 23:11
Talal Sultan12-Aug-07 23:11 
QuestionUPnP AV Client in C# Pin
N-O-R-B-E-R-T12-Aug-07 22:37
N-O-R-B-E-R-T12-Aug-07 22:37 
AnswerRe: UPnP AV Client in C# Pin
leppie12-Aug-07 23:39
leppie12-Aug-07 23:39 
AnswerRe: UPnP AV Client in C# Pin
leppie12-Aug-07 23:40
leppie12-Aug-07 23:40 
Questionhow to setup C# TCPClient timeout Pin
George_George12-Aug-07 22:36
George_George12-Aug-07 22:36 

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.