DSA_Dietmar's Q&A profile
SQL Server How do I retrieve a record by primary key?
Visual Basic 2005 Express: I want to retrieve an SQL DataBase table record whose primary key is 4. How do I read in that record and how do I pick up data from it In addtion to the previous poster you should take a look on the sqlcommand class. YOu will have to create a command like "Select * from Sometable Where PKColumn = @SomeValue") (substitute the * with the needed columns) Then add parameters with values to the command (use the parameter class for that) HTH, Jens K. Suessmeyer. --- http://www.sqlserver2005.de --- ...Show All
Visual Studio 2008 (Pre-release) Duplicate classes over WCF
I'm using WCF to talk to my db-tier from the client. The DB-tier defines some databaseclasses (using NetTiers). Those databaseclients are sometimes sent back through WCF to the client. So... VS2005 automatically creates 'stub classes' from those dbclasses on the client side. However, the problem is, when two different services returns the same databaseclass I'm getting two different stub-classes on the client side that isn't compatible with eachother (that is, the compiler isn't capable of casting one to the other). Is there any easy way of getting them compatible on the client side Regards Andreas you can let the svcutil generate the client once, have it compiled, then for the second you, you ...Show All
Visual C# Add Reference... won't work: Excel 11.0 Object Lib
Hello, I have installed Excel 2003, the Office 2003 PIA's, on a Windows 2003 machine. In VS 2005, I try to add a COM reference to Microsoft Excel 11.0 Object Library. The reference appears in web.config, but not in the Solution Explorer. I can't use it in my code this way, it won't compile. This behaviour seems to appear in Web site and Web service projects. In a regular application, it works fine. Anyone have an idea Kind regards, Koen Hi, In aspx.cs, add this "using" statement, [If you have added Microsoft Excel 11.0 Object Library then this will be available] using Microsoft.Office.Interop.Excel; and then in code, just write Application excel = new Application (); (This is Mi ...Show All
SQL Server Slowly Changing Dimensions
I am new to SSIS and I am investigating using the Slowly Changing Dimension transform. The data source that I receive is a daily snapshot of the external source system table. I need to store the history of the entity attributes (Type 2 SCD) and I am using the Start / End Date mechanism. When an entity (identified by the business key) is no longer received in the source snapshot, I would like the data flow to update the End Date of the current row to show that the entity has now expired. Does anyone have any suggestions for a good way to achieve this NB: Changing the source system extract to include and flag expired entities is not an option for me. Many thanks Graham Perhaps, you ca ...Show All
Windows Forms mshtml not returning results
I am working on creating a CCW, but am testing my code in a Visual Basic .NET 2005 with .NET 2.0 windows application. I am trying to get all of the href attributes from a web page. I have been looking around, and have found very helpful stuff that has gotten me to where I am, but now I am stuck. In my code I try to get the links from the links collection, and roll them out in a text box, but it is saying there are no links in the collection, but I know there is because if I use the webbrowser control it returns many of them (I can't use the webbrowser control in this circumstance though). Here is my code: [CODE] Imports mshtml Imports System.Runtime.InteropServices <ComVisible( True ), ComImport(), Guid( "7FD5 ...Show All
SQL Server Advice on query
Hi, Quite possibly this is easy but my brain is bazango'd right now and for the life of me I can't think of a good way to get the following... I have a table with 4 columns ID (int) User (varchar(200)) Timestamp (datetime) Note (text) The ID, User, Timestamp make up the primary key and nulls are not permitted in any column I'm trying to select the top 3 most recent rows [using timestamp] for each ID. anyone thanks in advance Mac Mac: Maybe something like this set nocount on declare @mockUp table ( ID integer not null, [USER] varchar (200) not null, Timestamp datetime not null, Note text not null ) insert into @mockUp values (1, ...Show All
Software Development for Windows Vista STANDBY power broadcast
Hi, I am working on interrupting the standby and hibernate of Windows Vista and am handling WM_POWERBROADCAST. I found that in XP the hibernate/standby msg parameter is PBT_APMQUERYSTANDBY while in vista it is now something else. can someone point me as to what the value changed to I cannot allow the machine to go into hibernate or standby. Hi, I have one problem. I'm calling SetSystemPowerState call to send the system to a sleep state in Windows Vista on a timer event. WM_POWERBROADCAST message is received, but the wParam is not set to PBT_APMSUSPEND. Instead, I'm getting PBT_RESUMECRITICAL message. Please explain me where the problem is coming and how can I solve that. Please note I'm working on WINDOWS VISTA and NOT XP (In XP, ...Show All
Windows Forms Resource transformation for file ... is not marked as serializable.
Hi! I need to translate big application into polish. When I`m changing Form language propety from (default) to Polish and then trying to compile, I have this message: [ ... ] Resource transformation for file 'MyFilesUC. resx ' failed. The type System. Windows . Forms . Control in Assembly System. Windows . Forms , Version= 1 . 0 . 5000 . 0 , Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable. Some Forms works fine, others not. ...Show All
Visual Studio Express Editions Change date format in DatePicker control
I want to cahange the date format in the datepicker control to Eg:-1-Jan-06 I know the string is "dd-MMM-yy" i just dont know where to use this what's the exact code you used I cannot see this error during compile or runtime, with option explicit set to on also make sure you added, just before setting the customformat value: Me.theDateTimePicker.Format = DateTimePickerFormat.Custom Me.theDataTimePicker.CustomFormat = "dd-MMM-yy" ...Show All
Visual C# Best way to achieve this?
I need to run a loop to check if a file exists then delete it. Once its deleted it can stop looking. However, at the time the loop starts it may not exist, but it will evntually be created. do { delete(); Console.WriteLine("Checking"); } while (check() == false); private static bool check() { if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat")) return true; return false; } public static void delete() { if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat")) { File.Delete(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat"); Console.WriteLine("Deleted"); } } I gave it ago and ran into some problems. private void mainForm_L ...Show All
Visual FoxPro SQL Server Express & Foxpro-populating SS from Foxpro
I've placed more of the code at the bottom of this message. The problem is with the Insert command with SQLEXEC. If I use: lcStr = ["INSERT INTO SAUTHORS(firstname,lastname) values ('] + m.firstname + [','] + m.lastname + [')"] lnResult=SQLEXEC(m.lnConn, m.lcStr) The error I get says: Connectivity error:...Could not find stored procedure 'INSERT INTO SAUTHORS(firstname,lastname) values ("Kareen","Abdul-Jabar")'. If I use: lcStr = ['INSERT INTO SAUTHORS (firstname,lastname) values ("] + m.firstname + [","] + m.lastname + [")'] lnResult= SQLEXEC (m.lnConn, m.lcStr) I get an error that says Invalid Syntax. Can someone steer me in the right direction I want ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Trying to move ContentManager to another class
After successfully building the "How to Render a Model" example in the XNA docs, I am trying to move: myShip = content.Load<Model>("media\\ship"); to a separate class and I was getting: Error 1 The name 'content' does not exist in the current context so I changed it to: myShip = Game1.content.Load<Model>("media\\ship"); and then I got: Error 1 'Game1.content' is inaccessible due to its protection level so I changed ContentManager content; in Game1.cs to: public ContentManager content; and now I get: Error 1 An object reference is required for the nonstatic field, method, or property I'm stuck now. Ideas Thanks! Greg the Content Manager is actuall ...Show All
Visual FoxPro software problem.
Hi there. I have question regarding one software that is builded on Visual Foxpro 7. I have a company and i have 4 computers in my office, i have a software for my company installed only in my computer... The problem is that i dont have the cd from my software and i have tried to copy all files from one computer to run that software in other pc`s. I have installed foxpro in other pc, i build the files from begining but isn`t working... When i click on the software it opens but after 1-2 seconds the program is closed automaticly, cannot run.. What can be the problem can anyone tell me any solution about this I will wait further for your message Thanks and best regards, armandino >That code you ...Show All
Software Development for Windows Vista Create Task within Loop
Hi everyone, First time posting here. I'm having a problem with developing a MOSS Workflow. The scenario is this: Within my workflow, I have a while loop construct. Within this while loop, there is a series of CreateTask->Wait for Task to be Changed -> CloseTask. It works fine until it loops back around to try to create another task with the same correlation token. In fact, that's the error I get. How do I get around this issue by disassociating the token or something like that. Thanks in advance for any help. rnellis2002 You should post this question to the SharePoint - Workflow forum found at http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=1207&SiteID=1 . ...Show All
Visual C# Where to find an straight to the point/easy/clear/concise sample on controls usage?
Hi All! Im quite new to C# but was already able to start a decent/simplified accounting system within two weeks but Im quite having some difficulties finding concise ( short and clear ) samples on using the controls (like datagridview, listview). Is there a site where I can view sample codes that are straight to the point . Hope some of you will not be offended but I noticed that some of the samples given here are lengthy and others are just instructions without actually real codes. There are standouts though like the sample on Voice Synthesizer. It was really great! I made the app talk in less than a minute just like what the author said. Thanks to all! search for quickstarts in msdn and also on web. y ...Show All
