Answer Questions
AndyW027 auto generate a value in database
i have a C#.net 2005 winform application in my ACCESS db patient table, i have PK patientID and index patientNo. on my formPatient, i have code to create a new patient and update the details to database. this.patientBindingSource.AddNew(); this.patientDataTableAdapter.Update(patientDataset.patient); I made the patientNo databound field to be readonly, I want it's value to be generated automatically based on the newly generated patientID. should i make the process "of generating patientNo based on new patientID" a stored procedure or a database trigger or others and how please help and be more specific in code as i am quite new to this scenario i asked around and heard that MS ACCESS does not support triggers at ...Show All
thomaskremmel Internet Connection State
How can i get state of internet connection (Online or offline) with C# Managed Code (No use Win API) You can use Ping class to ping some Uri like www.google.com ....... I hope it'll help. Best Regards, Rizwan aka RizwanSharp Here simple workaround method for you using System.Net; private bool IsInternetConnectionAvailable() { try { WebRequest WebReq = WebRequest .Create( "http://www.google.com/" ); WebResponse WebRes = WebReq.GetResponse(); WebRes.Close(); return true ; } catch { return false ; } } A small modification to the abov ...Show All
Temenos Develop Email That Works!
Protected Sub SendEmail_Click( ByVal sender As Object , ByVal e As System.EventArgs) Handles SendEmail.Click Dim mm As New Net.Mail.MailMessage( "sales@email.co.uk" , SendTo.Text) 'sendto.text textbox mm.Subject = Subject.Text 'textbox mm.Body = Body.Text 'textbox mm.IsBodyHtml = False Dim smtp As New Net.Mail.SmtpClient smtp.Host = "smtp.email.co.uk" smtp.Credentials = New Net.NetworkCredential( "sales@email.co.uk" , "saxxxxxn" ) smtp.Send(mm) End Sub C# translation: //import the System.Net/System.Net.Mail namespace: using System.Net.Mail; .. .. //some event example: button click: MailMessage theMailMes ...Show All
Tim Greenwood deployment from octopus tool
hi, when i try to deploy my application with the octopus tool on vista, it gives me an error on the prerequisite check that "access for the "octopus.test.file.bin" is denied". unable to resolve the problem... can anybody help me out regards, divya I don't know what the "octopus" tool is. This doesn't sound like the right place for that question. There's a forum for finding the right forum at: http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=881&SiteID=1 Is your application Vista compliant Check out http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnlong/html/netfx30.asp for more information. ...Show All
Sundaar Net framework2 and 1.1 setup
Can Netframework 1.1 be installed over version 2 Yes, all versions of the .NET Framework (1.0, 1.1, 2.0, 3.0) are designed to be able to install and run side-by-side. Thanks! Aaron ...Show All
Marshall Brooke Intermittent webservice issue...
I have a webservice that pulls data from an AS400 backend across an ODBC connection. On initial load of a page, it pulls the data without issue. If I refresh the page, any subsequent calls to one of the functions in the webservice fail, and I get the error: "SoapException: Input string not in correct format" There are only 2 calls to the service that generate this error. I had thought it was an issue with the data being returned from the AS400 (some of the data items were packed), but adding a "cast" call within the SQL doesnt help. Again, initial load works fine but any refresh fails. The functions in question return a dataset, and if I debug I get the error right when I go to fill the dataset. I also tried loading a d ...Show All
arikve I'm fairly certain I'm losing my mind....
For the past 3 days, I've been spilling my brains all over my keyboard in an effort to do something that should be ridiculously simple.... What's really driving me crazy is the fact that I've done it before... Here it is: I have a datatable in MS Access. In an effort to copy all of it's records to a table in SQL that I can access and better manipulate, I created an SQL Database in my Visual Basic program and made a comparable SQL Table. I gave all the columns identical names and comparable data values as the columns in the Access table. Now, I just want to copy the records from the Access table directly into the new SQL table. Here's the catch. I'm doing all of this through the DESIGN interface because the last line of ...Show All
Juvefan Cannot Add Web reference
Hi, When ever I try to add the following web reference in my application http://www.messagevista.com/subscribers/gatewayApi.asmx It will be given following Error message The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF Please help....... Regards, Dmp You'll need to contact someone at messagevista.com. They've implemented their web service in a non-standard way. It's unlikely anyone on these forums would be able to help with that. Hi, Thanks everybody, Basically I am getting this error meaasage whenever I try to add any third party Web Reference. I cannot understand what's the problem of my system. Thanks & Regards Dmp H ...Show All
WinFormsUser13232 data multiple bursts?
Hi. This is a question I've been meaning to ask but then sometimes able to resolve it by adding a small delay before sending the next message. I have a server/client app client connects and sends data via the network stream. .. this .theNetworkStream.Write(bytesOfData, 0, bytesOfData); this .theNetworkStream.Flush(); Thread.Sleep(140); //small delay this works fine when sending 1 piece of data at a time, but when sending it in a loop, sometimes the data is sent properly whilst other times the data for some reason is recieved at the server end in 1 big string, instead of chunks of data, even with the delay from the client. When recieving data on the server, I am doing ...Show All
TWReynol How to check if a column exists in a datareader
I'm up against this problem for which I'm surprised to find no help. I want to check if a column exists in the datareader before attempting to read it. If i don't check i get the indexOutofRange exception. There is similar functionality with datatable where we do dt.Columns.IndexOf("ColName") But how do we do this with datareader Good question. I don't know why they didn't add a method to check for the existence of a column that did not throw an exception. I assume they have some good reason, but I never looked into it. Throwing and catching exceptions like that is a bad practice. I probably shouldn't have even mentioned it as I wouldn't put code like that into production, even tho ...Show All
ivanbolcina Import Data from Sybase into a Recordset
Hello, I'm trying to import Data from a Sybase Database with a VB 2005 Application. Everything works fine, the only problem is, i receive wrong data out of Datafields which contain the style money (Currency). Trying different version of code as follows: Dim Price as Decimals = rs1a. Fields( "NW_Cur_PreisBrutto" ).Value Dim Price as Double = convert.toDouble(rs1a.Fields ( "NW_Cur_PreisBrutto" ).Value) Any Ideas what's wrong thank you, for taking time and give me a hand. Wolfgang Looks like your driver/provider has a scale mismatch with the server. By the way, what data access technology are you using – ODBC, OLEDB, .NET Can you find an a ...Show All
nope25546 How to display an image of the resources in an assembly in the WebBrowser control?
Hello, does anybody know how to display an image of the embedded resources in the WebBrowser control In VisualStudio 6 and the IE-control this worked like this: Code: "<IMG src=\"res://ErrorDialog.dll/Error.jpg\">" I tried it this way in .NET with the WebBrowser-control: I Code: "<IMG src=\"Properties.Resources.ImageError\">" but it doesn't work... Is there a way to do this Best Regards B. Ritter You can still use the res protocol if you embed the images as native resources. I don't think there's a way to directly refer to managed resources. The C# and VB.NET IDEs no longer support native resources. This ...Show All
Pp-Virmati what is 64 bit application
can anybody what is 64 bit application why do we go for 64 bit application need of 64 bit application nothing other than this i see I get a 20% speed improvement on one of our native apps running 64bit over its 32bit equivalent. The x64 architecture, instruction set etc are just better. How much of that is made use of by the .net JIT I don't know, since it's had the most love on the 32bit version. so I guess YMMV. The simple answer is that 64-bit applications are able to easily use more than 2GB of memory. Its RAM support is effectively unlimited with today's technology. There are quite a number of smaller benefits, but the RAM thing is most easily explained :-) -Ryan / Kar ...Show All
Residual Logic Games Non thread safe HashTable access
Hiya; I have to maintain a legacy app with serious multithreading problems. Service A Has an object (Foo) that contains a hashtable. Different methods occasionally add or delete items from the hashtable. Service A also Starts a thread which sleeps for 30 seconds and then gets a string array of the keys in the hashtable. Here's the evil code that the second thread calls ( Foo.GetAllTokens()): public string [] GetAllTokens() { ArrayList al = new ArrayList( _hashTable.Count ); al.AddRange( _hashTable.Keys ); return ( string [])al.ToArray( typeof ( string ) ); } And Here's what happens: Foo.GetAllTokens will periodically start failing with this exception: System.IndexOutOfRangeException: Index was outsid ...Show All
Eric van Feggelen Inserting more than one spaces in Drop down list
Hi, I want to fill a text having more than one spaces in the drop down list box. like ddlList.Add("Black : 000140") ddlList.Add("RED : 1258#") ddlList.Add("RED : 15000") But I cant. Any body can help me. Try: ddlList.Items.Add(Server.HtmlDecode("Black : 000140")) ...Show All
