Carsten-S's Q&A profile
Visual C# Problems with Nullable DateTime Type.
Hi all, I have a Class with a field called UpdatedDate that is of type DateTime. This field gets populated from teh database, but is possible (90% of the time that it is a NULL value in the database). I have the following statement that is throwing the following exception... Code: r ec.m_dtUpdatedDate = (!objSqlCeDataReader.IsDBNull((int)RecNspInspectionAnswer.Columns.UpdatedDate)) (DateTime)objSqlCeDataReader[(int)RecNspInspectionAnswer.Columns.UpdatedDate] : null; Exception Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DateTime' and '<null>' But if I was to place a ' ' in that same line of code after the (DateTime) such as follows it works fine. rec.m_dtUpdatedDate = ...Show All
SQL Server Viewing- VS Development Security
Hi everyone I am having some difficulty getting the security on the Report Server to function correctley. Here's what's happening: I log onto Report Server using a certain account. This account is linked to a security role on the cube and to a certain company code within the cube. After building a report in Report Builder using this account and deploying it, I then run it from Report Server. It only displays the values in the parameters that are allowed for this user that I have logged in with. This is correct. However when I open BI and build a report and deploy it, the security settings on Report Server no longer take effect correctley. The parameter dropdowns are left empty where a certain company code should be. Does a cert ...Show All
Visual C# Thread safe Form
Hi, I have a form with several controls which I am updating from different classes. I am looking for a thread safe way of doing this. I would prefer not to use the tedious Invoke/InvokeRequired technique. Is there an easier or perhaps better way of doing this, I have come across the idea of using an interface For clarity: class MainForm... Button specialMove = new Button(); ComboBox tenHitCombo = new ComboBox(); ... private void specialMove_Click(object sender, EventArgs e) { // new Thread for massive damage! Thread.Start() } // Thread Method string x = MainForm.tenHitCombo.Text //UNSAFE Thanks using the invoke/invokerequired is not hard at all and is best practice and safe. you could use a backgroundworker component in .NET 2.0 ...Show All
.NET Development Can you send me the code 2, pleace
Hi, Im using a custom UsernameTokenManager in WSE 3.0 but it always authenticates when it should'nt. I'm missing something but don't know what. my Web Service code is: using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; [WebService(Namespace = " http://tempuri.org/ ")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [Microsoft.Web.Services3.Policy("usernameTokenSecurity")] public class Service : System.Web.Services.WebService { public Service () { //Uncomment the following line if using designed components //InitializeComponent(); &nb ...Show All
Windows Forms Creating a install package.
Okay, the following is what I want to learn to do. 1. I want to create an installer for my program that I have. I know how to use the built in Publisher to create an installer but I want more features. I want the user to be prompted to enter a Product key, that has to be verified. Can anyone help me PLEASE! Regarding using third-party products within Visual Studio, this thread might be interesting: Lexpa.com - Inno Setup integration for Visual Studio ...Show All
SQL Server Create the package on the server, and execute through sql server agent
Hi, Some of you guys seem to be gurus with the new Integration Services technology, so I hope someone can lend me some advice, as I haven't worked much with integration before. Ok, here we go. What I want to do is select some data from my database and export the result to a flat file (really a .csv file with values delimited by semicolons). Sounds like a simple thing to do Well, I'm sure it is when you know how to do it :) I know I could manage the same thing by writing a C# class that creates that .csv file, but the decision has been made to use Integration Services for these kind of operations. I created an SSIS project in Business Intelligence Development Studio, and created a package (I defined the task flow etc.). By choosing ...Show All
Windows Forms Change "Just Me" to "Everyone"
In VS 2003 Deployment Project, how do I change the Installation Folder to default to everyone instead of just me, or better yet remove this option all together Thanks I have not worked with VS2003, but in VS2005, you just change the property InstallAllUsers of your Setup project to true. And it does the trick you want. It may be the same for VS2005. Regards, Wasif Ehsan. ...Show All
Software Development for Windows Vista [MDX1.1 / C# / DirectShow] Fast native memcopy from SampleBufferCB to Offscreen Surface
Hello, I'm doing the following thing and I'm wondering, whether there is a faster way doing it in .Net: I have a DirectShow Graph with a SampleGrabber Callback installed, for getting the uncompressed image data of a arbitrary compressed videostream. I have a ringbuffer containing previsously created Offscreen Surfaces, to which the grabbed image data is first copied to and later (in a separated thread) is displayed on a DirectX Surface. I've chosen to do it this way: public int SampleBufferCB(double SampleTime, IntPtr cbBuffer, int Len) { try { GraphicsStream gs = sfc.LockRectangle(LockFlags.Discard); if (gs.Length > Len) MoveMemory(gs.InternalData, cbBuffer, Len); / ...Show All
Visual Studio 2008 (Pre-release) Create and Attach Custom Behavior to Client and Service in Web.Config
I am trying to create a custom message inspector and attach them to the client and service. I was able to create the Behaviors successfully, but am not sure how to attach it to using the config file. I have a ClientMessage inspector and a server message inspector class. I created a BehaviorExtensionElement for the service side as given below: public class ServerMessageInspectorBehaviorSection : BehaviorExtensionElement { public override Type BehaviorType{ get { return this .GetType(); } } protected override Object CreateBehavior(){ return new ServerMessageInspector (); } } Is this right and Do I have to create another one for the Client. If yes Will it be almost the same. Then I ...Show All
Visual Basic Emails
Is there a way to send emails through outlook all the email addresses are on a server. Getting a list of appropriate recipients and sending the mail are distinct operations. The code as provided enables the sending of the email. Quick example - you would execute this line of code in your button click - after having provided the sub below, and possibly some re-ordering. Me .SendByDefaultMailClient( "My Message" , "Sample Mess" , " recipient@mydom.com ") Also, I don't think it a good idea to put the code that does the action in the button click handler. This means that you would be coding the action in all locations where you might provide access to this ...Show All
Visual Studio Express Editions Following item failed to download
Setup has stopped because the item listed above could not be downloaded... It dows that trying to install any Visual Studio Product. Have you gone through the download troubleshooting guide http://msdn.microsoft.com/vstudio/express/support/troubleshooting/ If you still have problems try to include more details about what is going wrong and what product it is. It might also be helpful to know what operating system you use. ...Show All
SQL Server Comm. between SQL Server data and Sybase SQL Anywhere Studio data
Hey folks, we are bringing SQL server technology in company and want to build the DB in SQL SERVER which currently needs to talk to one of the application which basically uses "Sybase SQL Anywhere Studio" as backend ,How this is possible Anybody knows or looking for detail explaination/process. ...Show All
Visual Studio Express Editions Fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
When I try to compile a win32 sample program, I get the 'fatal error C1083: Cannot open include file: 'windows.h': No such file or directory' error. I have installed and configured (even the step not in video) the most recent Platform SDK, but I still get this error! What is happening Thanks! What do you mean by this post The instructions on how to install the PSDK are given in the link you gave. Those are the instructions I followed. I do not have any explanation why the console application is working and the windows application is not. If I messed up somewhere please check the instructions you are reffering to, maybe these instructions are messy! Modeller ...Show All
Windows Forms Can't get DrawItem event any more, in some special case
This interesting thing was found by use of DebugView to monitor the all events. Suppose that there are 2 controls, one is propertyGrid, one is myListBox, which is a subclass of ListBox. myListBox uses OwnerDrawFixed mode, so it has to draw all items manually. However, in some mysterious case, I found that when I repeatedly opened and closed the propertyGrid, myListBox may never raise any DrawItem event. I output all events to DebugView, then found that WM_PAINT was there, but didn't WM_DRAWITEM. Also it can't restore from this bad status no matter what I did (move, refresh, resize, maximize, minimize...), until I recreate another myListBox. I think WM_DRAWITEM is nowhere to be manually emitted, since it's managed by control. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Game designing
I'm a Canadian citizen reside in Jordan , My son is 12 years old ,he has made a full online game (Designing and Programming ) which can be played all over the world live and it's now already live on internet , So kindly please advise me how to improve him ( where can he develop his skills and knowledge ) . F.Y.I he has never study programming and Designing he is a student. Regards B. Mirza It's always nice to see young people learning to program! I think I was 8 or 9 when I first started, and it was several years before I really began to grasp the fundamentals of coding. My parents used to give me a lot of grief about spending so much time on the computer, but now that I'm programming for a living, I get to say ...Show All
