Stephan Smetsers's Q&A profile
Windows Forms Commit changes to database
Hi, My Windforms DataGrid 1.1 is bound with two database columns. The user edits the contents and thereby changes the contents of the dataset the grid is bound to. I need to commit these changes to the database on a button click. Trivial question but i dont seem to be getting it right :( hi, i did that but since my sql table didnt have a primary key SQLDataAdapters auto generated update statement complained. I had to explicity add the Update Command to the DataAdapter, add parameters and then it worked like a charm. Rohan Wali ...Show All
Visual Studio Express Editions Error While Coding!!
I am following a book's direction to code, but when i entered this startment ' For intForLoopCtr = 1 To CInt (txtNoPics.Text) ' <<<<<<<< then it said 'intForLoopCtr" is not decared....... so anyone have any idea to make it decleared You need to be a bit more descriptive in what you telling us. And provide us with sufficient code to see what you are doing. This code could be either - just a string containing some code if the quotes are part of the actual line, or FormatNumber (CInt((txtNoRange.text * Rnd()) +1)) If the quotes are not part of the actual line then A call to a Sub called FormatNumber which probably you are showing as incorrect as it should p ...Show All
Visual Studio Express Editions reverting to default radiobutton checkstates
I have a dialog with some radiobuttons on it. I want to 'get' the .check value from each when it(the dialog box) loads-before any changes are made. Then when the OK button is pressed, the boolean values are renewed with the new values that the user clicked, but if the Cancel button is pressed, then no matter what changes were made, everything is put 'where it was', so to speak. Two thoughts: 1. You could use normal radiobuttons and store the state in the tag property, instead of defining a new control. 2. Unless they have been separated into several groups only one button can be checked at a time, so you only need to remember which button was checked when the dialogue loaded and set it back again when the Cancel button ...Show All
Visual Basic Problem with sockets
Hi buddies, How are you !! I got the following problem while i am developing a chat software My software consists of two parts: Server Client each in a seperate project, and each works very well when they are working alone, but when i try to test my application -I run the server then the client- i got the problem that when the client create the TcpClient object i got this message: Only one usage of each socket address (protocol/network address/port) is normally permitted I think that is because i use the same port number for both applications but this is the only way to run both applications on the same machine. the short version of my question is: How can I start a TcpListener and a TcpCl ...Show All
Windows Forms Performance impact on use of this/me keyword
The this/me keyword isn't required in many circumstances. Is there a performance advantage or disadvantage to using it when it's not required Gus No, it does not affect the performance in any way. Basically if you don't specify this/me the compiler will "autogenerate" it anyway. ...Show All
Visual Studio 2008 (Pre-release) [OperationContract] and properties,
Hi, Why is the below interface definition not possible Surely the fact that properties are just methods anyway mean that this should be possible. Why should it be necessary to change the perfectly reasonable Length property into a GetLength() method Is there any way to expose a property value /// <summary> /// Service contract definition. /// </summary> [ ServiceContract ] public interface IWorkContract { [OperationContract ] int Length { get ; } } You're right about sessions, they do exist and you can use them. But I wouldn't compare sessions state to properties. Transactions aren't there mainly so you can do 5 method calls and ...Show All
Visual C# SoundPlayer & device selection
I have a PC with both a SoundMax sound card as well as a VOIPVoice USB phone (i.e. Skype). After installing the USB phone (and resetting the SoundMax as the default audio device), all sounds I play with SoundPlayer go to the USB Phone and not the SoundMax. How can this be fixed It doesn't seem like System.Media.SoundPlayer understands the concept of multiple sound devices. :( :( :( Double-plus ungood. :( :( :( Please read the question carefully, this is not a hardware config issue. I'm trying to figure out whether the System.Media.SoundPlayer class allows the developer to specify which device to use. The API appears to be missing this level of control. ...Show All
Windows Forms Export Current Page to Excel
Hey Using C#, building a Windows Form Application, I have a DataGrid, showing set results from the MSQL table. If there anyway, I can have a button, (or Menu link or something), so when clicked, the application will open MS Excel, and export the data to the Excel Spreadsheet. I am sure I have seen somewhere how it is down, but I dont know. Can anyone point me in the right direction. Many Thanks Jamie For your Error 1, the correct syntax is: excel.Cells[RowIndex + 1, ColumnIndex] = row[col.ColumnName]; But I am getting a System.OutOfMemoryException during the export process. The error message is "Not enough storage is available to complete this operation", and it was thrown by the line " ...Show All
Visual Studio Team System Modifying a Table Column
What would be the steps to modify a table column The database schema has been imported. The project is under source control. The column of an existing table must be modified. Currently (eg): [ColumnName] [int] NOT NULL, Later: [ColumnName] [int] NULL, If I modify the table in Solution Explorer and save the file, I get an error "An object with name '[Table] dbo.[TableName]' exists in the database project. You may want to try Refactoring feature. In Schema View, find the column you want to rename, right click and select Rename ... Good luck! ...Show All
SQL Server Cannot get CREATE LOGIN from a Windows group to work
I have created a database fronted by an ASP.Net application. It's all nice and simple, and I only need a very simple level of security (and even that is only as a protection against accidents rather than maliciousness). My intention is that users connect using Windows impersonation (<identity="true">), with the database creator having full access and the public group (I'm talking SQL groups here) having specific premissions granted on specific tables. If I set <identity="false"> on my XP box the application connects to the database as [MACHINE\ASPNET]. This is easy to set up access for - I simply do a CREATE LOGIN [MACHINE\ASPNET] FROM WINDOWS and then within the actual database do a CREATE USER [MACHINE\AS ...Show All
Visual Studio 2008 (Pre-release) I Want to know that how to Add Subitems in ListView (Without Databinding)?
Hi, < ListView Margin = " 10,10,10,10 " Name = " lvwEmployee " ToolTip = " Employee Info " > < ListView.View > < GridView AllowsColumnReorder = " True " ColumnHeaderToolTip = " Employee Column Header " > < GridViewColumn Header = " Employee Id " /> < GridViewColumn Header = " Employee Name " /> </ GridView > </ ListView.View > </ ListView > I am able to add listitems using the following code. lvwEmployee.Items.Add("1033"); // Employee Id But How to Add SubItems (In this case Employee Name) after the above statement without using Databinding. ...Show All
Visual Basic My.Application.Log - deleting or re-starting that file
Each time my client application runs, I want the logfile to start anew, so if trouble happens, I can get to the heart of it right off. Besides, if I don't clean it up, it'll grow until it eats up my customer's disk, right I tried My.Computer.FileSystem.DeleteFile(My.Application.Log.DefaultFileLogWriter.FullLogFileName) , but the file "is being used by another process" which in really my process, even as the very first statement in Main(). So, how do I get this done How do I avoid "the logfile that ate Cincinnati" Glenn Gillette WareForeAnalysis@juno.com www.warefore.com Hi, you wouldn't really want it deleted on every new start because your customers will restart the app after a failure and t ...Show All
Internet Explorer Development Unable to cast mshtml.IHTMLDocument2 to IMarkupServices2 using mshtml Interop
Hi, I am unable to cast mshtml.IHTMLDocument2 to IMarkupServices2 in C#. I am using Microsoft.mshtml Interop assembly (version 7.0). The code snippet is IHTMLDocument2 pdoc; <pdoc assigned to a non-null value..............> IMarkupServices2 markup = pdoc as IMarkupServices; ...> value of markup here is NULL even though pdoc is non-null and the msdn documentation indicate that IHTMLDocument2 can be used to get a reference to IMarkupServices2 Thanks, Shiva To be more specific, i am able to get a non-null reference to IMarkupServices in case of a .Net Webbrowser control in a sample winforms application. However when i try to get a similar reference to that of a r ...Show All
Visual C++ converting an LPPOINT to a POINT
the title pretty much says it, how do i convert an lppoint to a point i am using arrays of lppoints and points so if there is an easier way for arrays please tell me thanks in advance o, i got confused there, ok then i want to get an array of cursor positions using GetCursorPos(); but the parameter for getcursorpos() is an LPPOINT how would i get those positions into an array of POINTs ...Show All
Visual C# Newbie in C#, the problem about 2 dimension array descending sort.
Hey all, I met the problem about 2-dimension array descending sort. E.g. int [,] intarry = new int {{0,1,2},{0,3,4},{0,2,3,}} I wanna have this intarry in terms of descending sort, as the 2nd item. E.g. the expected result will be intarry = {{0,3,4}, {0,2,3},{0,1,2}} From the information that I got from webstie, the 1 dimension array can be applied by reverse method of array. However, for the multiple array, the Comparer should be written. Furthermore, there are few information availble and one even with the commerical application, e.g. you have to pay for it in order to see the possible solution. :0( I am a little new in c#. Therefore, I may need some helps from you.... According to my case, can you do k ...Show All
