|
i am not talking about the physical size.
i am talking about the count.
check during run time.just place a brek point in the for loop and see whether TableList[i] is not greater than TableList[count].
right??
|
|
|
|
|
I believe that your error is that there is less than 4 checked items in the Table listBox so when the compiler tries to go to (for example) index 4 it is not found and it is out of range.
try knowing how many items are checked before you initialize the other array and u do the for loop.
you can do this
<br />
int count = TableListBox.CheckedIndices.Count;<br />
and continue the rest of your code
|
|
|
|
|
i've already checked that the number of items selected in the listbox are 4 through
int count=TableListBox.CheckedIndices.Count;
approach.
but still it doesn't work. Any other suggestions???
|
|
|
|
|
Sorry,
i cann't see any error in the code you are providing.
Try providing us more information and maybe we can help
|
|
|
|
|
can this be due to the .Net Platform being corrupt?
i'm really confused
|
|
|
|
|
Is it the first time you develop on this Platform?
|
|
|
|
|
The odds of that are close to zero.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thankyou for clearing that up
and YES this is my first project on this platform
|
|
|
|
|
paste the full code i will test and let u know
|
|
|
|
|
<br />
int count=4;<br />
int[] indice = new int[count];<br />
MessageBox.Show(count.ToString());<br />
for(int i=0;i<br />
indice[i] = TableListBox.CheckedIndices[i];<--Exception<br />
return indice;<br />
<br />
this is not C# coding
|
|
|
|
|
Why do you say that. (NB. the forum cut off everything after "for(int i=0;i" the line should have read "for(int i=0;i<count;i++)")
|
|
|
|
|
It is a good notice from you
But i didn't know that the forum cut that out.
Why don't u try to help that poor guy instead of loosing your time on unrelavent comments
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Saira Tanwir wrote:</div>plz reply quickly </blockquote>
This really bugs me. You're getting help for free, people will reply when they reply. No-one is 'on duty'
int count=4;
int[] indice = new int[count];
MessageBox.Show(count.ToString());
for(int i=0;i<count;i++)
indice[i] = TableListBox.CheckedIndices[i];<--Exception
return indice;
you need to check 'Ignore HTML tags in this message (good for code snippets) to post code with < in it. As I did.
Now, the issue is plainly that you don't have four checked indices. Why do you need to do this at all, why not just return the collection, or convert it to an array directly ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
well guys
the problem is still there
But thanks anyway for all thee help and ur precious time
regards
Saira
|
|
|
|
|
Well, it's a really simple one. You need to step through the code and see what's happening, if you need to do that, to be convinced that hard coding the number 4 when the list could have less items is a bad idea. You'll see that it blows up because there are not four items checked. Nothing else makes sense.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi folks,
I want to run a exe file from the windows service using c# in .Net 2.0. Now i have using the System.Diagnostis.Process to run that exe file but it wont run and it throw the error "Service process can not be added with service controller". how can i solve this problem .
My code is here,
ProcessStartInfo Pinfo = new ProcessStartInfo(System.Windows.Forms.Application.ExecutablePath.Replace("PSIS.EXE","ndatagen.exe"),TranId + " " + Properties.settings.Default.PmsPath);<br />
Pinfo.CreateNoWindow = true; <br />
Process Pros = new Process();<br />
Pros.StartInfo = Pinfo;<br />
Pros.Start();<br />
Pros.WaitForExit();
|
|
|
|
|
Hi,
First things first, please don't mind for posting this
here. This is very urgent, and the hardware forum is
really slow, so I had no choice. Apologies in advance.
I'm planning to build a high-end PC within a decent budget.
(At least I hope to)
I want to know whether the single core Intel 3.2 GHz CPU
or the dual core Athlon 3600+ will offer better performance?
(Let's say I have to choose between these two).
Also, is the single core 3.2 GHz Intel CPU 64 bit? I know the
Athlon 3600+ dual core is 64bit. Does having 64bit mean better
performance?
I plan to run very cpu intensive applications like Audio Workstations
and 3d Graphics software.
Basically, this is going to be a multimedia production and video
editing system.
Also, please tell me to what extent can the motherboard affect
the performance. Is is really a performance factor? Or will a
decent motherboard do?
Please let me know quickly as I have to make the decision within
a few hours.
Thanks.
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
hi,
can tell me how can i write code for windows authentification in c#.net 1.1 to connect the remote computer and getting the database back up from sql server 2000.
this is haneef
|
|
|
|
|
heres the connection string i use for creating SQl Server connection
ConnectionString="uid='sa'; pwd='sasa';"
+"Initial Catalog=;"
+"Data Source=.;";
if u want it with windows authentication onlythen use this
ConnectionString="Integrated Security=SSPI;"
+"Initial Catalog=;"
+"Data Source=.;";
where Initial Catalog is the name of the Databaseu want to connect to and DataSource is the name of the server u want to connect to. if u are working in a standalone environment having ur own PC as the server then use "." for data source.
hope this helps
Saira
|
|
|
|
|
how to change the vs 2005 projects into to vs 2003 in c# .net 1.1
The VS 2003 editor does n't allowing VS 2005 projects how can i open and use it
shaik haneef
|
|
|
|
|
|
You can not jump back. For that you will have to remove all .NET 2.0 features from current project and then ad those files in VS 2003 project. But why do you want to do that?
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
|
I have a combo box whose items are load from a List (List is not empty). I already set SelectedIndex = 0 to choose the first item in code. But at runtime, when I click the arrow, drop down list appear and I don't select any item, SelectedIndex will be set to -1. If I select an item, SelectedIndex will be other than -1.
I think SelectedIndex should be 0 even I click the arrow and don't select any item. Is there any body has same problem?
I'm ...
a fan of Manchester United
a fan of Ozzy Osbourne
a King of Nothing
|
|
|
|
|
It's a bug.
I have a list contains several items of Tag(int id, string name). I use "id" as ValueMember and "name" as DisplayMember. If the first item has name is an empty string, the problem will appear.
When you click the arrow, seems M$ implemented to select text value to get the index. If you have an empty string, it cannot select anything and the returned index will be -1.
I'm ...
a fan of Manchester United
a fan of Ozzy Osbourne
a King of Nothing
|
|
|
|