brohans's Q&A profile
Visual Studio Express Editions How do I print a form???
-Visual Basic Express 2005- To print a form in the older version 6.0 the line of code was something like form.PrintForm to print that form. I need to know the simplest way to print a form with Express. I figured it would be simple but maybe I'm missing something because I really need help... Please :) VB6 and VB2005 have a huge change, as you maybe aware of. To print, you would need to use the PrintDocument classes/printpage events - which involves drawing the string/control/whatever - it may be a pain but hopefully this documentation, and example included, will help you get started: http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx the advantage being that you can customize the way you ...Show All
.NET Development insert query error
Hi, I wrote an insert query in TableAdapter and it gave me this error “Failed to get schema for this query”. The query that I wrote was this INSERT INTO STUDENT (S_ID, S_NAME, S_DOB, S_ADDRESS) VALUES (@Param1,@Param2,@Param3,@Param4) So how can I solve the error Thank you You may want to identify what type of database you are working with, and of course post some of your code (with database connection string). ...Show All
Visual Studio 2008 (Pre-release) July CTP - Configuration Error
I have following web.config file. When I navigated to svc file in IIS in the browser, it throws following exception (Did ServiceModel sections change in July CTP ): Server Error in '/ADQuery' Application. What is the namespace of the type What is the assembly <clientCredentials type=" namespace.namespace. windowsAuthentication, assemblyname "> If this is a web application, and the type is in the App_Code directory, that doesn't work today, so you should put the type in a separate class library and provide a full type name. If the assembly is signed, you will also need the full type name with version, culture, and public key token. ...Show All
SQL Server SQL Server Setup failed to retrieve the SSL Certificate Name
When I try to install SQL 2005 Developer September CTP on Windows XP Professional it returns an error "SQL Server Setup failed to retrieve the SSL Certificate Name" . I was using a certificate from SelfSSL but removed it. Still no luck This appears to be an issue with SQL Reporting Services. If I don't install Reporting Services then I can install SQL 2005. I'm guessing that Reporting Services is now requiring a certificate and doesn't like the SelfSSL certificates Any ideas I got the same error as well. Selfssl had been previously used to install a cert with IIS for ssl testing. I removed the cert from iis and reporting services installed fine. Good luck Jay Skelly Microsof ...Show All
SQL Server VS 2005 - VB.NET - Connect to mobile SQL database from Desktop PC
I want to physically move my .SDF file to my desktop and then access this file from VS 2005 VB.NET. Ideally, I would want to access this .SDF file from MS Access 2003 but I undersand this is not possible. Here are my VS 2005 VB.NET statements.... Dim ConnPPC As New System.Data.SqlClient.SqlConnection("Data Source = C:\Documents and Settings\G014436\My Documents\SQL Mobile\ActMgr6CE.sdf") Dim mySqlDataAdapter2 As New SqlDataAdapter("select * from T0002_AE_Activity_Entry", ConnPPC) mySqlDataAdapter2.Fill(myDataSet2) On executing the last statement(fill)...I get the following error. function failed: An error has occurred while establishing a connection to the server. When connecting to SQL Server 20 ...Show All
.NET Development Event Handling using Reflection
I have created a Word object through reflection. I would like to associate an event handler to the word object's DocumentsEvents_Event_Close event( I can not have a reference of Word Object library in the project). This is the code i am trying to use to get this. But i am getting an error when i am trying to get the events it doesn't return to me anything and if I have the reference of Word it returns to me that event object objWord, objDoc; Type typWord = Type.GetTypeFromProgID("Word.Application"); objWord = Activator.CreateInstance(typWord); objDoc = objWord.GetType().InvokeMember("Documents", BindingFlags.GetProperty, null , objWord, null ); object [] docPar = new object [4]; docPar[0 ...Show All
Visual C# 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 TcpClient on the ...Show All
Game Technologies: DirectX, XNA, XACT, etc. C# modulus operator % sucks?
So in C# when I do -1%something I get -1, which means I can't really use it as an array index without a bunch of stupid error checking. Is there some way to force the modulo operator to actually give me numbers from my field (e.g 0-5 for modulo 6) Edit: Well, I made this post at 2:00 am and it shows, here is what I have issue with: i = (i+1) % 6 will result in numbers from 0 to 5, which I could use for an array index i = (i-1) % 6 will result in numbers from 0 to -5, which can't be used in an array index Obviously, the absolute value of those results would not conform to any logical value, either (for instance, array[-1] and array[1] would be the same value, even though they should be 2 values apart if I decremented twice ...Show All
.NET Development Setup a VPN connection with .NET
Hi, I want to create a gui that creates (managed or unmanaged) a new VPN connection in the networks settings area with a provided ip, username and password. Can somebody give me some basic code to start with Thanks a lot Hi Mike, I am sorry, but this post only describe how to connect to an existing connection, but not how to create a new one :(. I want to create a complete new VPN connection by code ...Show All
.NET Development Date Format
Dear all, How can I format a Chinese date format to a English(United States) date format(01-Mar-06), It means how can I make a date format regardless of Computer's Regional setting Thanks you Hmm, no, that's not redundant in the format the OP wants it. Specifying the culture is essential to get the correct 3-letter month abbreviation correct. "December" in German is "Dez" for one, wonder what it is in Swahili. For the record: I'm not German. ...Show All
SQL Server Please Help
I want to sum the value of a column that i'm creating in my data flow. After a derived column thats a column of numbers that i need to hve the value of the sum of all rows. I've tried to use the aggregate transformation but it doesn't work because after this transformation you loose all the columns except the one you sum. I'm lost. The best way would be to catch the sum value into a variable. I know thats problably easy to do but i can't seem to get it done. Thanks Adriano Coura (Brazil) I've already put a multcast in my dataflow. But how can i use the value that i've found in the aggregate I need to make a flat file that have the number(sum). So how i get the number to the FF Or how do i get the sql task to sum a column that it is on ...Show All
Visual C++ error LNK2001: unresolved external symbol _WinMain@16
I am a new user for visual C++. I used the version 6 for microsoft visual C++. I create the project under win32application. When I complie the program, it shows no errors and no warning. When i excute the program, I found the following error Linking... LIBCD.lib(wincrt0.obj) : Debug/TEST.exe : fatal error LNK1120: 1 unresolved externals Error executing link.ex. How can i solve that error. Best regards, thet thet See http://support.microsoft.com/default.aspx scid=kb%3bEN-US%3b125750 . ...Show All
SQL Server Adding member on a Role
Hi all, I'm wondering if I can add a member on my role inside an SP. something like this. -------- EXEC sp_addrolemember 'RoleName', 'UserName' but i can't use the above statemnt inside a stored proc. I'm getting this error msg Msg 15002, Level 16, State 1, Procedure sp_addrolemember, Line 19 The procedure 'sp_addrolemember' cannot be executed within a transaction. Is there any other alternative way to add a member to a role inside an SP Thank you so much and have a nice day to all You can commit the transaction inside the trigger before you execute sp_addrolemember, just put a COMMIT statement before the call to sp_addrolemember. This could have undesirable effect ...Show All
Visual Studio Tools for Office Outlook Addin and Folder Homepage
Hi, In my Addin-project i have one folder homepage. The homepage displays correct within the folder. BUT: don't the folder HP (and the WindowsForm within it) and the loaded addin share the same memory In my OutlookStart method from the addin i have initialized a singleton class with parameters, during Outlook startup. But when the Windows form of the folder homepage is created (user clicks at the folder), the already existing singleton instance is not available anymore. It contains null again, so it will be created a second time. Can someone explain this to me regards, Manuel Manuel, although both the homepage and the add-in run in the same process (and therefore in the same address spac ...Show All
Windows Forms Dynamic Graphics
Hi, I'm developing a windows application for Tablet PC. I have a tab control on a page and many tab pages in it. When user fills data and saves, all the tabs that fails the validation should be marked (the tab page header background should be changed which will easily visible to the user) I tried using CreateGraphics and using FillRectangle to fill the boundary of the tab page exposed by Bounds property but it's not working because I found that Graphics can only be used in OnPaint event. The question is: Is there a way Graphics can be handled dnamically without being written in Paint related events Thanks, Shyam Hi Ye, Thanks for the suggestion but there is a problem. All the tab ...Show All
