VishalOnline's Q&A profile
Windows Forms Primary Key Violations
Hi. I have a simply table called "DryingSetup" with the following fields. DryingSetupID : Int : Identity : Primary Key Description : VarChar(100) I have a DataGridView on my form the is bound to the above table. If I insert records one at a time in the grid and save after each of the record additions then all works 100%. If however I add a few records (4 or more) and only then click "Save", then I get errors. Sometimes I get the error "Concurrency violation : The UpdateCommand affected 0 of the expected 1 records and generally I get an error saying that I have violated the primary key constraint. These ...Show All
.NET Development cannot get web application service
When I try to add a new SqlDataSource and click 'Configure...' I get an error message "cannot get web application service" and then it won't let me click 'New Connection' to setup the connection string. Any thoughts Thanks in advance. I had a similar problem with SQLExpress (I was working through the examples in "Begining ASP.NET 2.0" - Wrox), using Visual Web Developer Express. My solution was to save my work, shut VWD, reopen it, reload my work - and hey presto it worked Guess VWD syill has a few little bugs. ...Show All
.NET Development Text in XSLTransform
I am transforming one xml file to another using XSLT file. I create XSLTranform and load the stylesheet before calling the transform function. It seems to work fine but there are a few problems with text. When the XML file that I am trying to transform includes special text such as "£" sign the transformation will fail. I assume that I need to set some parameter to support w_char or unicode somewa, but I can't seem to fine the information needed. Can someone please help, or point me to where I can find more information on the matter. Thanks in advance! Thanks for the link. I have had a read, but can I use thi ...Show All
Visual Studio Exec task with ContinueOnError=true
I'm using an MSBuild build script as part of a continuous integration scenario. Part of the script is a target that runs unit tests with NUnit, using a batched item group that specifies test assemblies. The target contains an Exec task that runs the test runner application. Since I want to run all of the tests, even if some of them fail, I specify the ContinueOnError option on the Exec task. The problem is that even though some tests fail, MSBuild sets the DOS errorlevel is set to 0 after the build finishes, which screws up the continuous integration server (it thinks the build succeeded). If I change ContinueOnError to false, then it sets ...Show All
Microsoft ISV Community Center Forums Reading data dll into excel
I have recompiled a Visual Foxpro table into a DLL using VFP9. It is registered and VFP reads the DLL correctly. The DLL is just a table with code that performs a lookup based on two values and returns a value for use. In Excel, the following code is in a module: Declare Function spec_Field_Value_Function Lib "spec_search" (cThisSize As String, cThisValue As String) Public Function spec(Shape As String, Property As String) As Variant Dim SteelSearch As New spec_search.spec_Field_Value spec = SteelSearch.spec_Field_Value_Function(Shape, Property) End Function In a spreadsheet, text is placed in two different cells and th ...Show All
Visual Studio Team System unenable code analysis
Hello, I do not know how this happened but it appears Code Analysis is enabled in my VS 2005. Unfortunately, there is no way to unenable it without the Team Edition. So this results in a build error - unable to spawn fxcopcmd.exe. Any ideas Registry settings A couple of questions: Have you installed the Visual Studio Team Foundation Client (TFS Client) Was the project created or edited on a system with Visual Studio Team System installed You can disable the Code Analysis by manually editing the csproj/vbproj and changing the RunCodeAnalysis element to false, for example: < Prope ...Show All
Visual Studio Team System Dropping Files into Source Controlled Projects Fails Checkout
I have just created a project within Team System and checked the source code in. Now when I drag and drop newer files in, generated from CodeSmith, it asks the following questions... "Destination File Exists [Title] A file with the name "xxxxxx.cs" already exists. Do you want to check this file out and replace it [ ] Apply to all items. Yes, No, or Cancel" I select "Apply to all items" and then "Yes". However the files never get checked out. (This is my issue.) How do I get it to check these files out when I drag them into the project and they already exist It does, however, change my lo ...Show All
SQL Server Linked servers and Windows Authentication
I have seen similar questions, but none of the answers have solved my problem. I have several SQL2000 servers running under Win2003. In the past, we have been using SQL logins, but I have been trying to transition to using Windows Authentication. It has been working great except that sometimes queries using linked servers fail. The linked servers are set up for the connection to use the login's current security context. For testing this problem, I have limited myself to two servers to do this between. My Windows account is defined with sa rights on both servers. I have tried explicitly to impersonate my account, I have told it to ex ...Show All
Windows Forms Does BCL support all HTML native interfaces?
Hi, I am trying to use web browser object, access its DOM, add, remove elements, use IDocHostUIHandler, etc. I have realized that BCL sometimes doesn't give interface pointer, neither supports those interfaces. Please see my example below: template<typename T, REFIID riid> T* NativeQIOnObject(System::Object^ o) { IntPtr punkMngd = System::Runtime::InteropServices::Marshal::GetIUnknownForObject(o); IUnknown* punk = static_cast<IUnknown*>(punkMngd.ToPointer()); T* pT = NULL; HRESULT hr = punk->QueryInterface(riid, ( void **)&pT); return pT; } This te ...Show All
SQL Server SQL Server 2005 - Auto-indent???
Hi, I recently installed Sql Server 2005 SP1 and plan to use it going forward as my primary database engine. I'm creating my first SQL Server 2005 database - everything so far is going well and I really do like the improvements over 2000 as far as the tabbed interface goes... First problem though ... I've just began to create a stored procedure, and am noticing that in the SQL Server 2005 T-SQL Query text editor, it does not auto-indent the next line of code for me when I enter a carriage return - i.e. it goes back to column 1, and I have to manually hit the Tab key several times for each line that I type to ensure my code is indented ...Show All
Visual C# c# express graphics
Can anyone give me a free-standing C# program that would, for example, draw a line from point A to Point B I need to develop a program to do graphing, and I'm sure I could take it from there, but I have not been able to get started. I have Visual C# Express. Have a look at the following links, they should get you started. Bob Powell's GDI+ FAQ http://www.bobpowell.net/ GDI+ for Beginners http://www.c-sharpcorner.com/2/gdi_plus.asp ...Show All
SQL Server Management Studio connecting to remote Analysis services Server
Hi, When trying to connect to a remote analysis services server the option to change the authentication mode is grayed out. This means that I cannot connect to the server. Is there a way to tell Management Studio to use mixed mode for Analysis Services as is currently the case for my SQL Server installation Thanks in advance Jay I have a a similar problem. I'm trying to process a cube on a remote server in a different domain. Is there any way to do this ...Show All
Windows Forms default IDE control font
How do you set the default font for all development in Visual Studio 2005 (or V C# Express). Currently, when I create a new form and place controls on it they always default to Microsoft Sans Serif, 8.25pt, I want tahoma, but don't want to have to constantly change it. I have look all over but only see fint settings pertaining to the coding environ. Thanks. There is no setting that allows you to change this. Control (which Form derives from) actually gets it default font from the static Control.DefaultFont property. Unfortunately, this font defaults to MS Sans Serif, instead o ...Show All
Visual Studio 2008 (Pre-release) How are InvokeRequired/Invoke supported in WPF?
Are they I need to port this to WPF, but InvokeRequired has been removed from the control and there is no form :(( public static void AppendText( Form form, TextBox textbox, string text) { if (textbox.InvokeRequired) { AppendTextCallBack CallBackAppendText = new AppendTextCallBack (AppendText); form.Invoke(CallBackAppendText, new object [] {form, textbox, text }); } else { textbox.AppendText(text); } } The Winforms syntax you're describing is now done with the Dispatcher object. All controls have a Dispatcher object. Your code snipped would trans ...Show All
Windows Forms GDI plus in .net 2.0 advantages
I have a winforms app in .net 1.1 that extensively uses GDI instead of controls on forms, as there is lot of content. Now, we are migrating to VS 2005 on .net 2.0. What are the features of the GDI+ in .net 2.0 that I should look at leveraging How different is it from the GDI of 1.1 GDI+ isn't a new feature in 2.0, it's been there since .NET 1.0. GDI is the old graphics API part of Win32. I don't know if there have been any significand changes to GDI+ in 2.0, but I know that there's now in fact better support for GDI (with the TextRenderer class for example) since some people had problems using GDI+. ...Show All
