Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading csv file into a dataTable Pin
Muammar©17-Sep-08 1:25
Muammar©17-Sep-08 1:25 
GeneralRe: Reading csv file into a dataTable Pin
Ashfield17-Sep-08 2:11
Ashfield17-Sep-08 2:11 
AnswerRe: Reading csv file into a dataTable Pin
Colin Angus Mackay17-Sep-08 2:16
Colin Angus Mackay17-Sep-08 2:16 
GeneralRe: Reading csv file into a dataTable Pin
Muammar©17-Sep-08 4:53
Muammar©17-Sep-08 4:53 
GeneralRe: Reading csv file into a dataTable Pin
PIEBALDconsult17-Sep-08 5:22
mvePIEBALDconsult17-Sep-08 5:22 
GeneralRe: Reading csv file into a dataTable Pin
Muammar©17-Sep-08 13:37
Muammar©17-Sep-08 13:37 
GeneralRe: Reading csv file into a dataTable Pin
PIEBALDconsult17-Sep-08 16:44
mvePIEBALDconsult17-Sep-08 16:44 
QuestionGet a value ID from a ListBox,which is bind to a Data source. Pin
CJGun16-Sep-08 23:06
CJGun16-Sep-08 23:06 
Hi,im bit new to .net and Now im stucked in this matter for few days!! Sigh | :sigh:
If Some one can help me,it will be great!!

What i want to do is,Im loading data to the left side listBox as follows
//Loading the AssistanceType
DataTable dtAssistanceType = ((MasterUI)this.ParentForm).ObjRemoteObject.VoTBL.GetAssistanceType();
ArrayList arAssis = new ArrayList();
arAssis.Add(dtAssistanceType);
lstTypeofAssistanceLeft.DataSource = dtAssistanceType;
lstTypeofAssistanceLeft.DisplayMember = "AssistanceType";
lstTypeofAssistanceLeft.ValueMember = "AssistanceTypeID";

Assistance[] ass = new Assistance[] { };
lstTypeofAssistanceRight.DataSource = ass;
lstTypeofAssistanceRight.DisplayMember = "AssistanceType";
lstTypeofAssistanceRight.ValueMember = "AssistanceTypeID";

And then ,when i press a button,i want to add the selected item to the right listBox and get the ValueMember (ID) of the selected value!!
I did it like this,

DataRowView dr = (DataRowView)lstTypeofAssistanceLeft.SelectedItem;
Assistance objAss = new Assistance();
//objAss.AssistanceTypeID =Convert.ToInt16(dr["AssistanceTypeID"].ToString());
//objAss.AssistanceType = dr["AssistanceType"].ToString();
lstTypeofAssistanceRight.Items.Add(lstTypeofAssistanceLeft.SelectedItem);
objAss.AssistanceTypeID = Convert.ToInt16(dr["AssistanceTypeID"].ToString());
objAss.AssistanceType = dr["AssistanceType"].ToString();
int id = Convert.ToInt16(lstTypeofAssistanceRight.SelectedValue);

But when i did like this,it doesn't give any ID!!!
But if i bind a data source to LeftlistBox,it wont allow me to add items!
If i didnt bind the dataSource it wont give the ID.

Anyone knows the solution for this???

Thanks alot!!!
AnswerRe: Get a value ID from a ListBox,which is bind to a Data source. Pin
CJGun17-Sep-08 19:15
CJGun17-Sep-08 19:15 
Questioncsv imports Pin
rahuladya16-Sep-08 23:05
rahuladya16-Sep-08 23:05 
AnswerRe: csv imports Pin
Giorgi Dalakishvili16-Sep-08 23:14
mentorGiorgi Dalakishvili16-Sep-08 23:14 
GeneralRe: csv imports Pin
Alan Balkany17-Sep-08 4:15
Alan Balkany17-Sep-08 4:15 
GeneralRe: csv imports Pin
Giorgi Dalakishvili17-Sep-08 4:21
mentorGiorgi Dalakishvili17-Sep-08 4:21 
AnswerRe: csv imports Pin
Mohammed Hameed17-Sep-08 1:00
professionalMohammed Hameed17-Sep-08 1:00 
GeneralRe: csv imports Pin
Ashfield17-Sep-08 1:22
Ashfield17-Sep-08 1:22 
Questionset Icon in the Add/Remove program Pin
lune1216-Sep-08 21:50
lune1216-Sep-08 21:50 
AnswerRe: set Icon in the Add/Remove program Pin
Muammar©17-Sep-08 0:53
Muammar©17-Sep-08 0:53 
Questionif a form is already opened ,new form should not been opened Pin
maifs16-Sep-08 21:46
maifs16-Sep-08 21:46 
AnswerRe: if a form is already opened ,new form should not been opened Pin
Nagy Vilmos16-Sep-08 23:43
professionalNagy Vilmos16-Sep-08 23:43 
AnswerRe: if a form is already opened ,new form should not been opened Pin
DaveyM6916-Sep-08 23:55
professionalDaveyM6916-Sep-08 23:55 
QuestionUndo Off/Disable/Suspend Pin
Khaleek Ahmad16-Sep-08 21:46
Khaleek Ahmad16-Sep-08 21:46 
Questionsystem time Pin
lankaudaranga16-Sep-08 20:56
lankaudaranga16-Sep-08 20:56 
AnswerRe: system time Pin
Giorgi Dalakishvili16-Sep-08 21:02
mentorGiorgi Dalakishvili16-Sep-08 21:02 
QuestionC++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 20:56
Programm3r16-Sep-08 20:56 
AnswerRe: C++ Crc Method to C# Crc Method Pin
Guffa16-Sep-08 21:24
Guffa16-Sep-08 21:24 

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.