Answer Questions
Ritesh Singh system.web.mail works, system.net.mail fails
I'm still fighting this changeover to system.net.mail. I have the same error message you showed above. I have a web page that sends the same email text two different ways, or tries to. This one (using real addresses) works: System.Web.Mail.SmtpMail.Send("me@there.xyz", "you@there.xyz", "subject of my email", "body of my email") This one does not: Dim sc As New System.Net.Mail.SmtpClient() Dim message As New System.Net.Mail.MailMessage() sc.Host = "localhost" sc.Port = 25 Dim fromAddress As New System.Net.Mail.MailAddress(txtFromAddress.Text, txtFromName.Text) message.From = fromAddress message.To.Add(Me.txtToAddress.Text) message.Subject = "testing smtp at ...Show All
A.Russell HttpWebRequest & CookieContainer broken design & implementation
I've spend several months working with HttpWebRequest & CookieContainer, and simply had a miserable time making it work. My question is whether there's a better approach/workaround to it, and if not hopefully these bugs will be fixed by next 'patch'. Issue #1. HttpWebRequest does not setCookies for redirects until the end of redirect. Suppose you have a scenario where you log in, gets a 302 redirect with a SetCookie header. Now, the new redirected page verifies that the cookie is set before sending the correct response. Using HttpWebRequest & CookieContainer, the second redirect request does not have the cookie that response #1 specified, and thus you can never log in using these APIs. The only workaround I found so fa ...Show All
haryindsfjdbf Problem with creation URI like "http://s3.amazonaws.com/turk-worker-upload/part%2Fpart%2F?parameters"
The subject somehow results in: "http://s3.amazonaws.com/turk-worker-upload/part/part/ parameters" Is there any way to exclude such behavior Hi, I will try to be more detailed. Input: string url = "http://s3.amazonaws.com/turk-worker-upload/part%2Fpart%2F parameters"; Uri uri = new Uri(url); Expected result: uri.AbsoluteUri is "http://s3.amazonaws.com/turk-worker-upload/part%2Fpart%2F parameters"; Actual result: uri.AbsoluteUri is "http://s3.amazonaws.com/turk-worker-upload/part/part/ parameters" ; And as result 404s error after: WebClient web = new WebClient(); byte[] bytes = web.DownloadData(uri); This thing is really annoying... Can anyone please help or maybe I am miss ...Show All
Punpromk What did I do wrong (Getschema method in SQLServerCE)?
I have a problem with the Getschema method in the SQLServerCe namespace - I am fairly new in C# so I may have overlooked something. My problem is that I have only the C# Express edition (I don't have the mobile projects) so I am "forced" to make my own viewer for my SQL Compact databases (.sdf) as I can't use SQL server Management Studio Express for these files. However, when I use the Getschema() method in the corresponding namespace it seems to not work. This is the code I used: string connstring = @"Data Source=c:\!studiec#\betatest.sdf" ; SqlCeConnection myconn = new SqlCeConnection (@connstring); myconn.Open(); DataTable mytable = myconn.GetSchema(); I get the error "Spe ...Show All
HadaytUllah The same table <choice> cannot be the child table in two nested relations
I have a xml file generated by third party. I need to display the content on datagrid to let user modify and write back to the xml file. Usually I create a dataset and read the xml into it. But this xml file is different from those i have worked on before which it gives me such error message as in the subject. What should I do The above document states that bug has been fixed as part of VS2005 SP1, but I still get the same error when instantiating my strongly-typed dataset... Does anyone have any additional information on the following This problem/issue affects several industry standard schemas utilized by the manufacturing industry. see http://www.wbf.org/ ...Show All
Madiba Formatting text boxes
Good Morning, i have an SQL Server database feeding VB.Net forms, how would i go about formatting a text box to display a telephone number correctly. Example: Current: 7054447569 'this is what i currenty have Formatted:705-444-7569 'this is what i would like to have the output look like If anyone can help me that would be greatly appreciated Hi You can use a MaskedTextBox and assign the mask YourMaskedControl.Mask = "000-000-000"; Cheers You'll want to specify a formatting string of something like "000-000-0000" to accomplish this. How are you setting up your binding or moving of the data from your SQL query to the TextBox Worst case if you've got the value in an ...Show All
deen serialport.close hangs
Hi, This subject has been discussed before but the suggested solution didn't help me. I'm calling serialport.close() from a form.closing event and the program never returns from the serialport.close. I do discardoutbuffer before closing, but doesn't help. Does anybody have a solution to that Thank you. dan Here's another thread that saw similar behavior. Not closing the port is quite acceptable in my book, at least until MSFT fixes this problem. It is not yet reported in Product Feedback though, you might want to file a bug report; use this thread as a reference... Yes, I've seen it. But as mentioned in my first post it doesn't apply to me. I open the port at startup, and close ...Show All
Paul Taylor how to unloading xml document to reclaim memory?
I have noticed that when I try to unload xml document by calling Release() on Document MSXML2::IXMLDOMDocument pointer the memory occupied by the DOM (when I call load) is not returned back. Is calling Release on MSXML2::IXMLDOMDocument pointer is good enough to reclaim the memory used up by DOM after calling load You also have to release every IXMLDOMNode in the tree that you might be holding onto. ...Show All
M.A.T Timeout expired.
I'm getting this error intermittently when execting a sql command. I tried increasing the timeout property of the command object, but sometimes I still get the error. Other appplications may be acessing the same tables. Is there a way to prevent the error System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. can you show the code you are using Perhaps its the firewall that is intereferring with the connection.... Setting the COMMAND timeout seems to work, but when debugging the ContectSwitchDeadlock MDA is activated. How do I resolve the ContextSwitchDeadlock I don't get the error every time. Only someti ...Show All
Thomaschr Reading a part of a text file
Can I read only a part of a file (specified by an offset and the number of lines or bytes or whatever to read) WITHOUT loading the entire file into memory (that's what streams such as FileStream do) In other words, is there a workaround, so that in memory I should have only the part of the file that I need, NOT the entire file (and then seek for the required records while the entire huge file is loaded into virtual memory) Could someone point me in the right direction for this, please C# or C++. Thanks a lot. Nope, you're wrong. A FileStream (or any Stream derived object) takes very little space on the heap. A Windows file handle (4 bytes) and a 16 byte buffer is all. What takes a whole heck-of-a-lot of space is trying ...Show All
St&#233;phane Beauchemin Class issue
Hi, I have some code that initiates a different class depending on what treeview node is clicked. I have the name of the class stored in an XML file. What I'd like to know is would it be possible to retrieve the class name from xml and then declare it by using that name. The problem I've been having is getting visual basic to recognize it as a class object. Is there some way I can do this Thanks for any help Chris Activator.CreateInstance(Nothing, srv_Name) Since you're not doing anything fancy with application domains, then Activator.CreateInstance is just as good. (In fact that gets called by CreateInstanceAndUnwrap). Either one should be fine really. ...Show All
Hummer Windows 2003 R2 w/ .NET 2.0 (64 bit) won't allow component to load
Got a stumper here. I have a server running 64 bit Windows Server R2 and it has the .NET 2.0 framework installed (64 bit version). I'm trying to install a .NET 2.0 component used within a website, but when I try to install it, it says I have to have the .NET 1.1 framework installed and aborts. I'm using the same installer I used on a 32 bit version of the same OS. It has only the 32 bit .NET 2.0 framework installed and didn't make a whimper. The company selling the component has no requirement documentation for OS or .NET versions, but they claim the component is .NET 2.0 compliant. Any ideas on how to solve this This might be useful in IIS once I get the component to install in the first pla ...Show All
amr_sawy Run application as user
Hi, I'm writing a web service where one method will launch another .NET program under a specified users account. It launches fine as the NT AUTHORITY\NETWORK SERVICE user when I dont specify a username/password for the processStartInfo but I am having trouble getting it to work when I specify any other username/password pair. I immediately get "The application failed to initialize properly (0xC0000142). Has anyone ever gotten this to work using Process.Start/ProcessStartInfo Note I do *not* want to impersonate the client nor have any of the other code run during the processing of the request run using any credentials other than NETWORK SERVICE, just the third party app I want to launch and get the stderr/stdout streams back f ...Show All
tornin2 Strange SQL connection problem.
I am building a windows forms app and I get this error when I connect to the DB The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. The strange thing is if I put a breakpoint at the line that causes the error ; SqlConnection con = new SqlConnection (ConnStr); Hit the breakpoint and then F5 to continue, the code runs fine . The code only fails if I do not have a breakpoint on that line of code. The database is a SQL2000 db on another box referenced by an IP. Thanks for any help or ideas on this. PatC Without knowing or seeing the rest of your code, I'm going to take a stab and suggest you look at flushing your buffer. System.Window ...Show All
tawm Is there a Groups property that can be used to iterate Named captures
Hello all, If you define a pattern with named captures (eg ( <Name>^\w+ \w+) you can then reference the group directly using Groups("Name"). I would like to be able to iterate the groups by name something like this: For Each group As Group In Match.Groups If group.Name = "Name" Then ' Do something End If Next I have not been able to find a property that exposes the named capture. Am I missing something obvious here Thanks in advance for any ideas and/or suggestions! Thanks OmegaMan! That's better but it still brings back everything so unnamed groups are brought back also as "0", "1", "MyName1", "MyName2", etc. There is not ...Show All
