|
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.
|
|
|
|
|
|
Hi,
I am getting the daily rates. I just want to know the formula to convert.
Suppose i got amount 140 in GBP now i want to convert it into EURO so what will be the formula.
Regards
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi,
you will need this formula:
x (in Euro) = y (foreign currency) / z (current rate).
For example for the 140 GBP with a rate of 1 € = 1.5 GBP the formula will be
x = 140 / 1.5 = 93.33 (Euro)
If you have the rate like 1 GBP = 0.67 Euro you need this formula:
x (in Euro) = y (foreign currency) * z (current rate)
Hope this helps.
Regards
Sebastian
|
|
|
|
|
the formula is: multiplication.
It is similar as converting inches to millimeters, and much simpler than converting Fahrenheit to Celsius.
|
|
|
|
|
I am writing an application to migrate records from a DocuShare document management system to a TRIM Records management system.
Moving documents (anything that is not an email) is straight forward, but for some reason DocuShare takes any email that is lodged and ripps it up into component pieces and stores these in a database table.
I can find the To, From, Subject, Body, Header and other data and now my challenge is to reconstitute the original email so I can move it into TRIM.
I have tried using the Office.Interop.Outlook class to create an email, but I can't include the Header or the From Information.
I.E.
Outlook.MailItem mailItem = new Microsoft.Office.Interop.Outlook.MailItem();
mailItem.Body = "This is My Test";
mailItem.Subject = "Test Message";
mailItem.Attachments.Add("C:\\AttachmentDocument.txt", Outlook.OlAttachmentType.olByValue, 1, "AttachmentDocument.txt");
mailItem.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
mailItem.To = "ToPerson@theirEmail.Address.com";
mailItem.BCC = "";
mailItem.CC = "";
mailItem.SaveAs("Path", Outlook.OlSaveAsType.olMSG);
Does anyone know of an other way to recreate these emails so that I can include the header and from (and maybe other) fields?
|
|
|
|
|
RCoate wrote: DocuShare
You might want to have a look at their documentation to see if they provide any solutions.
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.
|
|
|
|
|
Yeah, DocuShare documentation is fairly sparse, does not cover anything other than documents (nothing on emails) and is really quite useless.
I have done quite a bit of research on all available DocuShare tools, sdk's and api's before starting this project.
One thing I found out from dissecting their database is that they do not save emails (unless the email is an attachment to another email), so you can not export emails.
|
|
|
|
|
How do you take a byte array and get a textbox to display it as it is bit wise.
So for example if I have a byte it gets displayed as maybe 00010100
thanks for helping out the newbie
ps: Please reply if you want to share how to do this and do not reply otherwise... thanks.
|
|
|
|
|
Hi,
This should be the solution: (copied from MSDN)
txtFieldInBinary.Text = Convert.ToString(valueToDisplayAsBinary, 2);
|
|
|
|
|
You could write your own code to do this -
public class ShowBits {
public static void Main() {
int t;
byte val;
val = 123;
for(t=128; t > 0; t = t/2) {
if((val & t) != 0) Console.Write("1 ");
if((val & t) == 0) Console.Write("0 ");
}
}
}
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.
|
|
|
|
|
public class ShowBits {
public static void Main() {
byte val;
val = 123;
for(int i = 7; i >= 0; i--) {
Console.Write(((val >> i) & 1) + " ");
}
}
}
|
|
|
|
|
Hi Thanks for answering.
I don't understand (val & t).
I will look it up
|
|
|
|
|
Here's[^] an older article of mine that has what you need and more.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|