|
Oh, and why use ArrayList rather than a generic collection?
|
|
|
|
|
Hi,
ArrayList or Generic I don't know.
I have to store in some kind of array items that each have three properties (long,long,string).
I need a way to have the array be dynamic in order to avoid instantiating a huge array.
thanks,
|
|
|
|
|
public struct MyStruct
{
public long x;
public long y;
public string z;
}
List<MyStruct> array = new List<MyStruct>();
|
|
|
|
|
Thanks for the answer
|
|
|
|
|
That is still the PDF reader, right?
I suggest you study some more before you attempt all this, you seem to be drowning. I suggest you buy and study an introductory book on C#. In a few days time, you will understand bytes from characters, and collections from arrays.
Two detail suggestions:
- don't use ArrayList, use a generic List<T> instead;
- avoid structs until you fully understand value types (which won't happen in a fortnight) ; if you think you do, you still don't, and you will get into big trouble putting them in arrays or collections all the time.
|
|
|
|
|
Hi Luc (Bonjour?)
Yes, lollll it does feel like drowning sometimes...
I will start downloading a few C# books from www.ebookshare.net and start reading this weekend please let me know a recommendation if you have a great one.
I need to write code at the same time I learn otherwise it doesn't stick well.
That's why I drown a lot right now... lots to learn
Thanks for the comments, always welcomed.
Antoine
ps: I am still reading the PDF reference, and still making progress, partly thanks to people like you. Its a nice personal project.
|
|
|
|
|
Bazewouelle wrote: please let me know a recommendation if you have a great one.
I don't, as I consider book preference a very subjective matter in general, and I learned C# about 10 years ago. I always did like the Microsoft Step-by-step series. And I do recommend a real book, something you own, hold, study, put aside, read again later, etc. This[^] tells you more.
|
|
|
|
|
I have "C# for Dummies" and "Professional C# 2nd Edition", but I generally refer to the spec.
|
|
|
|
|
Is it possible to get the "Results View" from the ICollectionView? If so, how?
I don't want the "SourceCollection" but instead the "Results View".
Thanks for help!
|
|
|
|
|
I have a checkbox in Gridview. I can able to enable and disable checkbox using javascript. I am getting checkbox.checked as true even though it is unchecked. Can u help me out.
<asp:checkbox id="chkIs360" enabled="false" runat="server">
// Enable checkbox //
chkIs360.disabled=false;
if(chkIs360.parentElement.tagName == 'SPAN' && chkIs360.parentElement.disabled == true)
chkIs360.parentElement.disabled = false;
|
|
|
|
|
SPAN/span?
|
|
|
|
|
I think you should try to ask this question at ASP.NET[^] forum.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
I agree. I've seen this forum cluttered with so many misplaced messages, it looks like a teenager's bedroom!
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|
|
Disabled elements (and possibly their child elements) do not post back to the server. If you are disabling a control and it doesn't get posted back, your code-behind will try to figure out its state from the ViewState. Why are you disabling a SPAN? I generally try to keep all of my code that determines wheter something is enabled or not either all on the server or all on the client. That way they don't get out of sync.
Another trick you could try is to enable all of your controls in the OnClientClick of your submit button or whatever causes postback to make sure they get the values the user sees.
|
|
|
|
|
Hi,
I am currently writing some unit tests for my C# application, so I made an Access database with various datasets containing multiple test values. The first column contains an ID which is only a number starting at 1 in the first row, and is increased every next line. This is my primary key.
I implement this test database in my Test class like this:
[DataSource("System.Data.OleDb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\TestData.mdb", "CValues", DataAccessMethod.Sequential), DeploymentItem("Tests\\TestData.mdb"), TestMethod()]
This works fine, however when I display the test results in VS 2010, the "Data Row" does not match the order in my database. Currently, my Database has about 30 entrys, and the datarow-output in VS 2010 begins with row 8 from my database, going to the end, and the first 7 rows in my database are displayed as the last datarows in VS 2010.
I would really appreciate if I had the same datarow order in access and VS2010 so I can easily compare both of them.
How can this be achieved?
|
|
|
|
|
Hi,
AFAIK database query results are ordered as much as you request them to be in a specific order; without an ORDER BY clause, they are in random order.
If you don't want to add an ORDER BY clause, the best you can do is sort the results yourself before comparing them with your expected set of results.
|
|
|
|
|
Thanks, this worked great, I simply created a Query called ValuesSortedQuery which I use in my DataContext, the query is really simple and looks something like this:
SELECT *
FROM Values
ORDER BY Values.ID;
Works just fine
|
|
|
|
|
So here's the situation: I'm trying to fetch a series of files from a webserver (the request is handled by a php script which redirects to a txt file,if that matters). I use a BackgroundWorker to loop through the number of files to fetch and a HttpWebRequest to get the filename and contents (I think I have to use HttpWebRequest because I need the filename). Then I use the WebRequests GetResponse() method to get the filename from the headers and the content from the Response stream. However, the program hangs at the third call to GetResponse without fail.No exception, no nothing. This code will reproduce the problem: (It is the minimum I have to do to reproduce it, it only retrieves the filename)
for (int i = Start; i <= End; i++)
{
HttpWebRequest HWR = HttpWebRequest.Create("http://www.deckcheck.net/export.php?deck=" + i.ToString() + "&type=txt") as HttpWebRequest;
HWR.Method = "GET";
HWR.KeepAlive = false;
WebResponse Resp = HWR.GetResponse();
Name = Resp.Headers["Content-disposition"].Substring(Resp.Headers["Content-disposition"].IndexOf("filename=") + 9);
System.Windows.Forms.MessageBox.Show(Resp.Headers["Content-disposition"].Substring(Resp.Headers["Content-disposition"].IndexOf("filename=") + 9));
}
It's always the third call since program startup, too.
I havn't done much network coding, so if you need more info, just ask.
|
|
|
|
|
you're not showing any error handling; if there is none in a BackGroundWorker's DoWork handler and an exception occurs, the DoWork handler will finish right away, the RunWorkerCompleted handler will be invoked, and its e.Error parameter will hold the exception. I recommend:
1. you have a look at e.Error.ToString()
2. provide error handling inside DoWork
|
|
|
|
|
True, I don't have any error handling to speak of. However, I know it's not that kind of error because
A) the RunWorkerCompleted event is never raised
B) Stepping through the code or pausing execution when the program hangs, everything just kind of..stops, at the GetResponse() call. I can't step further.
C) I tried adding a catch both inside the DoWork handler and where I start the backgroundworker going and the result is the same.
Thanks for the tips, though, I really should make exception catching a habit.
|
|
|
|
|
Maybe http://www.deckcheck.net/export.php?deck= is the problem?
Also, you may want to start reading the response stream and close it before displaying a message box. Try reading your headers and response.Close() before using a message box. Also, only because I can't stand it, don't name local variables starting with a capital letter. There is a reason C# is case-sensitive.
|
|
|
|
|
Hi All,
I want to convert EURO currency to GBP,USD,CHF,SEK etc. Dosenot any one knows the formula should i use to convert each currency to EURO. I am getting current rate of each currency.
Thanks
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Currency rates are changing all the while - so you will need to communicate with a web service / site that provides updated currency rates.
Once you have the correct rates, updating the currency should be easy.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Hi Abhinav,
I am getting all the current currency rates just need a formula to convert each curr inEURo.
Will try and let u knkow?
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|