Antarctica's Q&A profile
Windows Forms OpenFileDialog throws ThreadStateException
Hello. I have converted a C# project from VS 2003 to 2005 and am now continuing to work on it. It all seems to work fine, the some small issues could be solved very quickly. I have also converted the project files design manually to VS 2005's, with Form.Designer.cs files and a Program.cs containing the static Main() function. I've copied the code partially from other solutions newly created with VS 2005 so that it's complete. Now I wanted to use an OpenFileDialog in my application but as soon as it is to be displayed, it throws a ThreadStateException telling me I should add the STAThreadAttribute to my "main function". (Not the exact wording, that's in German. You can google that wording very easily.) But the initial Main functio ...Show All
Visual C++ Building standard unmanaged win32 DLL which calls functions in a managed C# library
Hi, I would like to build a standard DLL which calls managed code library. Is it possible If possible, how Can anyone provides some references to online resources With many thanks. Ok, yeah you are having a bit of a problem. The program.cs file is a C# file. When you add it to the C++ project, you are going to have huge problems because the C# code inside program.cs will be compiled with the C++ compiler. See where I'm going here So in order to get this to work, you need at least 3 projects. The C# project containing program.cs. It will output a DLL The C++ wrapper project. It will also output a DLL The native C++ project. (1) should just be compiled as you would any other C# project. (there is no /clr flag ...Show All
SQL Server SQL server 2005 POOR performance on a good dev machine
Hi there, I was wondering why my installation of SQL server 2005 on my Del inspiron notebook is so slow when using the Management Studio. I get the message that sql server is waiting for a process to finish quite often and it just seem to be bloody slow in general- like when i populate a table by hand I have a dual core intel 2.6gHZ Dell Inspiron with 1gigs of RAM and a 7200rpm drive. It should be more than sufficient. Regards Mike Well, client tools are really slow ones, in comparation with SQL 2000 tools at least, this is true. But engine works perfectly, and mostly faster than SQL Server 2000 engine does. ...Show All
Visual Basic Newbie needs guidance on the next step past GUI--Importing Stock Data into App
I'm taking a VB class for financial analysts, and we're tasked with constructing a progrm we can use on the job. What I'm trying to do is build a VB program that will take Stock and Company information from certain sites on the Internet and extracting that information into the program to do some research on a company before investing. I have some grand plans, but based upon what I have read/heard I'm starting by taking stock information from two websites (Yahoo Finance and Reuters) and populate several different tabs in this program I'm making (exporting to an Access database and Excel are also in the works, but I'm taking baby steps). I built the GUI with 4 different tabs that will house Earnings data, Trading Information, Company News, ...Show All
Visual Studio 2008 (Pre-release) WS-Addressing exception
I am writing a WCF client. I want to include WS-Addressing information to the message before calling the service. The following is the code. I am getting an exception when I setting ReplyTo . The exception is e.Message "Addressing Version 'AddressingNone ( http://schemas.microsoft.com/ws/2005/05/addressing/none)' does not support adding WS-Addressing headers." string using ( Microsoft_AddressClient proxy = new Microsoft_AddressClient ( "BasicHttpBinding_Microsoft_Address" )) { Console .WriteLine( "Sending SSN# to web service: " + cmdTaxPayerID); Console .WriteLine( "Requesting Employee address information..." ); try { GetAddressRequest request = new GetAddressRequest (); reque ...Show All
Windows Forms Flattening entity collection for display in Grid
hi, consider the following entities. public class Address { string street; } public class Customer { private int _name; Dictionary <string, Address> _addresses; public int Name { get { return _name; } set { _name = value; } } } As shown, Customer entity has a collection of Address entity. (a customer has more than one address). The problem is that when i want to show the data in grid (its a winforms application), i want to have a flat display of data. e.g. for a customer having three adresss. i want the data to look like: Customer Address1 Address2 Address3 Name Street Street Street ======= ======== ======== ======== Dinesh ABC DEF XYZ After data has been displayed, i want to be able to sort, filter the dat ...Show All
SQL Server Automatic sync between SQLce and Access
Hi, I am converting an old eVB application to CF.NET 2. It's a very simple setup. 1) An Access database sits on the host and has occasional edits applied to it. 2) An application on the PDA with a mirror copy of the Access database (filtered data) and also has occasional edits applied 3) When the user puts the PDA in the cradle the databases get automatically synchronized with each other. Probably couldn't get much simpler than this. This used to be very easy to do with PocketAccess and ActiveSync. Unfortunately this is no longer supported. I decided to use the new SQLce database instead when porting to CF.NET. It's working like a charm except that I haven't found an easy way to synchronize with the desktop Access application. Mer ...Show All
Smart Device Development How To Define Global Variable?
Hi, I want to define a global variable which can store information like Database Connection String and can be accessed accross all the forms and classes in my application. While loading the application, I would like to set this once and then use it throughout my application. How to do this Also, what is the use of Resources.resx and AssemblyInfo.cs files in the application Can they be of any use Regards, Suman Hi, if you need to make a value what ever it was and use it from in form, then you either store it in the registry or in a file, db,.. etc if you don't know the way of doing this, tell me and i'll be glade to help you. the Resources.resx file is used to keep resources in your application to use it from there, like image ...Show All
Visual C# Working with Excel files - MSDN let me down :-(
Hi all, I'm having major problems accessing Excel data in files. I've found the following snippet which seems to work: Range range = firstSheet.get_Range("A1", "C3"); //Retrieve the data from the range. Object[,] saRet; saRet = (System.Object[,])range.get_Value(Type.Missing); //D ...Show All
Microsoft ISV Community Center Forums [OTP] VBA Using combobox in Excel
H i there, I'm working on an engineering spreadsheet (Excel) and need some help in manipulating comboboxes / dropdown list. Say i have 2 list, where list A has the list of countries and list B has the list of cities for the country chose. If all the data source (i.e. countries and cities) are to be extracted from the Excel spreadsheet, is it possible to make list B dependant on list A (that is to say when user selects a country in list A, list B will automatically gives the respective cities) WITHOUT creating a userform If so, please advise how. Hope you can understand what i'm trying to ask here. Fyi i have minimum VB knowledge so a "dummyproof" explaination would be really ...Show All
SQL Server SQL 2005 - Consuming web services in a Stored Proc
Assume I've created a web service named 'SaveActivityData' for some SQL 2005 database on some remote server. Also assume that the stored proc takes two parameters; the first is an integer value and the second an XML value. 1) Is it possible for a stored procedure on a completely different SQL 2005 server to consume this web service 2) If the above is possible, could someone show me an example of the T-SQL syntax required to consume this web service, passing the two required parameters In your example, you can make up whatever URL you like for the remote web service location. Thanks very much - Amos. I worked it out. (I thought I had tried this, but obviously not!!) request.Method = " ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Game Programming
Hello could i know if someone knows any tutorial ( on-line or off-line ) about DirectX 9.0c or lesser... im trying to make a game ( ) and if don't have any tutorial i must get another way ( like OpenGL ) thanks, bye Have a look at the XNA Framework and the Game Studio Express systems, you can find forums on this site that have lots of content to get you started. Also if you check out the dev center at http://msdn.com/xna you will find even more links to resources to help. ...Show All
.NET Development StreamReader and StreamWriter
I have problems using StreamReader and StreamWriter. everytime i copied a textfile from StreamReader to StreamWriter. the files bytes are in different size. please need help on this matter. Dim sstream As New StreamReader("c:\EULA.txt") Dim sstream2 As New StreamWriter("e:\EULA.txt", FileMode.Create) Do Until sstream.Peek = -1 sstream2.WriteLine(sstream.ReadLine) Loop sstream.Close() sstream.Close() more info: the destination file E:\eula.txt has more bytes (file size ) than the source (c:\eula.txt) please i need help ...Show All
Smart Device Development Setting the parent of a form raises exception in NET CF 2.0
Hello, I just ported an application from NET CF 1.0 to NET CF 2.0 (SP1) and I get the error System.ArgumentException: Value does not fall within the expected range. at Microsoft.AGL.Common.MISC.HandleAr() at System.Windows.Forms.Control._SetParent() at System.Windows.Forms.Control.set_Parent() at com.incahellas.FormHelper.PrepareForm() at com.incahellas.FormHelper.ShowForm() at pocketerp.Form1.MainWorkA() at pocketerp.Form1.set_Func() at pocketerp.Form1.Form1_Load() at System.Windows.Forms.Form.OnLoad() at System.Windows.Forms.Form._SetVisibleNotify() at System.Windows.Forms.Control.set_Visible() at System.Windows.Forms.Application.Run() at pocketerp.MainClass.Main() } whenever I try to set the parent of a form. Does anybody kn ...Show All
Visual Studio VS .NET 2003 debug broken with windows XP SP2/VS2005
I have recently installed windows XP service pack 2 and a trial demo of VS2005/VSTS on my PC. Now I can't debug in VS .NET 2003. I get:- "Access denied. Verify that you are an administrator or a member of the 'Debugger Users' group on the machine you are trying to debug. After being added to the 'Debugger Users' group, you must log off and log back on for the setting to apply". My MDM isn't running and when I try and start it I get:- "The Machine Debug Manager on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service." I have looked through all microsoft articles I can find and tried everthing they sugge ...Show All
