Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralRe: MS Access Pin
Dave Kreskowiak15-Jan-08 9:25
mveDave Kreskowiak15-Jan-08 9:25 
GeneralRe: MS Access Pin
Dan Neely15-Jan-08 10:48
Dan Neely15-Jan-08 10:48 
Questionxmlns validate with regex problem Pin
two_man_only15-Jan-08 8:05
two_man_only15-Jan-08 8:05 
AnswerRe: xmlns validate with regex problem Pin
Shimmy Weitzhandler17-Jan-08 8:02
Shimmy Weitzhandler17-Jan-08 8:02 
GeneralRe: xmlns validate with regex problem Pin
two_man_only17-Jan-08 8:21
two_man_only17-Jan-08 8:21 
GeneralGet Current User From Windows Service Pin
Lash2015-Jan-08 5:53
Lash2015-Jan-08 5:53 
GeneralRe: Get Current User From Windows Service Pin
Justin Perez16-Jan-08 3:48
Justin Perez16-Jan-08 3:48 
GeneralDataTable Suggestion Please [modified] Pin
doubleas238015-Jan-08 5:09
doubleas238015-Jan-08 5:09 
Hello everyone, If you have time, I need some suggestions.

I am making a mileage calculator, it is a project I thought up for me to gain some c# coding skills. Anyway, my dilemma is as follows.

I have a form with 6 combo boxes, one is a "START" and the other 5 are optional "ENDING" routes. Basically, someone can select "Indiana" on the first combo box and select "Akron" on one of the others, hit the calculate button and it will tell the mileage.

I have a DataTable set up with 3 columns "FROM|DEST|DIST" so it would be like
"Indiana" "Akron" 120
"Indiana" "Kalamazoo" 211
"Kalamazoo" "Phoenix" 1100

My problem is when i populate my first combo box with the "From" category, I get tons of duplicates, as there are many names in the from category that are the same. How Im adding data is below (Yes its being hardcoded, I dont know enough about databases to set one up yet)

xDt_List = new DataTable();<br />
<br />
      xDt_List.Columns.Add("Start", typeof(string));<br />
      xDt_List.Columns.Add("Dest", typeof(string));<br />
      xDt_List.Columns.Add("Dist", typeof(short));<br />
<br />
      DataRow xDr_Row = xDt_List.NewRow();<br />
<br />
      xDr_Row["Start"] = "Indianapolis";<br />
      xDr_Row["Dest"] = "Kalamazoo";<br />
      xDr_Row["Dist"] = 211;<br />
      xDt_List.Rows.Add(xDr_Row);<br />
<br />
      xDr_Row = xDt_List.NewRow();

and so on and so forth...

Thank you for *any* suggestions on how I could make this a little more effecient ect.

modified on Tuesday, January 15, 2008 11:16:32 AM

GeneralRe: DataTable Suggestion Please Pin
Not Active15-Jan-08 5:37
mentorNot Active15-Jan-08 5:37 
Generalremoting and window service Pin
poqeqw15-Jan-08 4:41
poqeqw15-Jan-08 4:41 
GeneralRe: remoting and window service Pin
led mike15-Jan-08 4:46
led mike15-Jan-08 4:46 
Generalcustome Components Icon Pin
Abhijit Jana15-Jan-08 4:00
professionalAbhijit Jana15-Jan-08 4:00 
GeneralRe: custome Components Icon Pin
Judah Gabriel Himango15-Jan-08 11:27
sponsorJudah Gabriel Himango15-Jan-08 11:27 
GeneralRe: custome Components Icon Pin
Abhijit Jana15-Jan-08 18:11
professionalAbhijit Jana15-Jan-08 18:11 
GeneralEditing and Printing an word document Pin
Matjaz-xyz15-Jan-08 3:57
Matjaz-xyz15-Jan-08 3:57 
GeneralRe: Editing and Printing an word document Pin
martin_hughes15-Jan-08 4:12
martin_hughes15-Jan-08 4:12 
GeneralRe: Editing and Printing an word document Pin
Matjaz-xyz15-Jan-08 4:42
Matjaz-xyz15-Jan-08 4:42 
QuestionMonthCalendar Pin
Scotty15-Jan-08 3:14
Scotty15-Jan-08 3:14 
GeneralRe: MonthCalendar Pin
Pete O'Hanlon15-Jan-08 3:43
mvePete O'Hanlon15-Jan-08 3:43 
GeneralRe: MonthCalendar Pin
Scotty15-Jan-08 3:58
Scotty15-Jan-08 3:58 
Generaldownloading a file from an url to the server Pin
I Never Look Behind15-Jan-08 3:00
I Never Look Behind15-Jan-08 3:00 
GeneralRe: downloading a file from an url to the server Pin
Not Active15-Jan-08 3:15
mentorNot Active15-Jan-08 3:15 
GeneralCan't find XML file Error Pin
NewToAspDotNet15-Jan-08 1:22
NewToAspDotNet15-Jan-08 1:22 
GeneralRe: Can't find XML file Error Pin
Luc Pattyn15-Jan-08 1:32
sitebuilderLuc Pattyn15-Jan-08 1:32 
GeneralRe: Can't find XML file Error Pin
NewToAspDotNet15-Jan-08 2:36
NewToAspDotNet15-Jan-08 2: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.