I get the following message: The type or namespace name 'Soap' does not exist in the class or namespace 'System.Runtime.Serialization.Formatters' (are you missing an assembly reference?) On this line here: using System.Runtime.Serialization.Formatters.Soap; What am I missing or has something chnaged in .NET 1.1? (I'm trying to use the BaseSerializable class in this article: http://codeproject.com/soap/soapseraialize.asp )
ABean
Posts
-
using System.Runtime.Serialization.Formatters.Soap; -
Pretty Weird Request Here...Sorry, chief. I reread it and I still don't see where I went wrong; I did what the guy asked. I hope your solution below is what he needs.
-
Pretty Weird Request Here...I just downloaded it and it compiles without any errors for me (VS.NET 2003) in both debug and release.
-
form load and Resize eventI have a Resize method that I want called only when the user changes the size of the form. But when I Load that form for the first time I notice that the resize event gets called. Is there some way to prevent this?
-
releasing PictureBox's Image file handleGot it. Thanks. ------------------ pictureBox1.Image= Image.FromFile(MyFile); pictureBox1.Image.Dispose(); pictureBox1.Image = Image.FromFile(AnotherFile); System.IO.File.Delete(MyFile);
-
releasing PictureBox's Image file handleIn the code below I load an image into a PictureBox using the Image.FromFile method. When I am done with that image I would like to release it so that I can delete it from the hard drive. However, even after I set the PictureBox's Image property to another image I still can not delete it. Obviously my process still has a handle to the file but I can't find a way to release that handle. I tried looking through the methods and properties of pictureBox1.Image but I did not see anything that looked useful. Any ideas? ------------------ pictureBox1.Image= Image.FromFile(MyFile); pictureBox1.Image = Image.FromFile(AnotherFile); System.IO.File.Delete(MyFile); //This fails becuase MyFile is "in use by another process"
-
how to scrolling through "stacked" images?Does a control exist where I can load it with any number of images (one on top of the other) and then vertically scroll through them for viewing? My images will all be the same width but not the same height. I was thinking to host a webpage in my app and have local tags for the images but I don’t want the overhead. Any other ideas you would be great to have. Thanks!
-
Inserting SQLSever rowsWhat is the easiest what to load 4000 rows into a SQLSever db from a C# program? The C# rows are in an ArrayList. And the "scheme" is very simple [string, date, decimal, decimal, integer]. I’m looping threw the array, right now, and doing an insert for each row but I’m wondering if there is some way I can do this in bulk? I think BCP would be overkill in this case, so, I'm just wondering if there is something in ADO.NET that might handle a "large" number if inserts.
-
Unsubscribing from an eventI have an instance of class A that publishes an event and several instances of class B that subscribe to it. How can I get a B instance to UNsubscribe from the event?
-
DataGrid "logical" row from HitTestI did some more reading and it looks like I need to put a primary key column on my table - and then I guess I will hide it. But even if I add the primary key column how do I resolve the HitTest Row number from the DataGrid into a DataTable row number?
-
DataGrid "logical" row from HitTestThanks Heath, I'm binding to a DataTable. I've looked at the DefaultView property as well as the other properties of the DataTable but I am unsure how to translate the HitTest Row number from the DataGrid into a row number of the DataTable. I need to get the DataTable row number integer not to update the actual row in the control but to update an associated array. (DataTable row number is the index into the array.) I looked at the Find property but the rows displayed in the table are not unique. It this translation possible?
-
DataGrid "logical" row from HitTestGuys, On the datagrid when you do a HitTest you get the "physical" row that the mouse is over. If the user has sorted the grid (by clicking on one of the column headers) and changed the order of the rows is there a way to get the "logical" row from the "physical" row? Thanks
-
DataGrid, Generic GDI+ errors, and a Big Red XI ran into a similar problem before. I understood that I had to update the control on the thread that created it and I wrote a queue mechanism to do this. However, I was surprised to see that the asynchronous callback from the event ran on different thread. (Now its obvious but it was unclear to me then.) Try setting the thread name property on the form where you create your datagrid. Then do a simple debug assert against this thread name property in the asynchronous callback to ensure that you are updating your datagrid on the correct thread. This will at least tell you whether or not your async callback is on the same thread. (My guess is that it isn’t but I’m still new to this .Net stuff) //Place this in the form init Thread.CurrentThread.Name ="UI thread"; //Place this in the async callback Debug.Assert(Thread.CurrentThread.Name =="UI thread"); Heath’s recommendation about Invoke is sound advice.
-
C#'s sprintfHeath, I just read your article; thanks for posting it. It brings together all the MSDN articles that I had read and the ones that I missed and it cuts straight to the point. Thanks again.
-
C#'s sprintfThanks Heath, You beat me to my post below. :)
-
C#'s sprintfI think I got it. . . Its done by passing args to the ToString() method.
-
C#'s sprintfIs there an equivalent to sprintf in C#? Basically I have some C# "value types" (floats, decimals) that I would like to format into a string variable. Also, I have a DateTime variable that I would like to format into a string variable. What is the best way to do this? Thanks.
-
Determining app close by User or WindowsI have a C# Windows Form that contains the logic to display an icon in the systray. I have that form hidden (visible = false). When the user clicks the systray icon I unhide the form (visible = true) to allow the user to change some settings. When the user finishes changing the settings he can click the close button (the X in the top right corner). In the frm.closing event I have this: this.Visible = false; e.Cancel = true; That code will hide the form for later use and it keeps the application from exiting. Life is good UNTIL the user goes to shutdown the computer. During the shutdown process Windows goes to close my application; but my app sends Windows the Cancel signal and so Windows never shuts down. I’m about ready to hack something up with WndProc but I was hoping there might be some way to tell if whether my app is being closed by Windows or by a click of the close button (the X in the top right corner). Thanks.
-
adding a C file to a CPP projIs it possible to do that for a single file in VC7? MSDN seems to indicate that the only way to do this would be to stick it in its own sub-project. In any case I would rather not change ANY environment settings because this is for inclusion into an open source project that can be compiled on many platforms/compilers. Renaming it to CPP seems to be the easy way out. It’s just a collection of functions so I really can’t see how it would hurt. But thought it would be good to check with you guys first.
-
adding a C file to a CPP projI added a C file to a CPP proj and got an error complaing about the precompiled header thing. MSDN says I should create a subproject and stick the file in that. However, I would rather not create a new sub project for a number of reasons. As a solution, I found that I could rename the .c to .cpp and get it to compile file. Everything works but I'm wondering if there is a ticking time bomb just waiting to happen after this program goes into production. Thanks, Al