swlee's Q&A profile
Windows Forms chaging formWindowState.Minimize to formWindowState.Normal
I want to write some code that is triggered when the window state of my form chags formWindowState.Minimize to formWindowState.Normal, is there a way of capturing this event i have looked at the "resize()" event, but no idea whether it is the one and how to implement the process. please help Yes, the Resize event is best. For example: public partial class Form1 : Form { private FormWindowState mState; public Form1() { InitializeComponent(); mState = this.WindowState; this.Resize += RestoreDetect; } private void RestoreDetect(object sender, EventArgs e) { if (mState == FormWindowState.Minimized && this.WindowState == FormWindowState.Normal) Console.WriteLine("Minimized -> Restored&quo ...Show All
SQL Server change Parameter order
Hello, I'd like to change the order in which Parameters are displayed. When I go to the menu Report - Report Parameters and change the order with the arrows displayed - I'll get the following error msg.:The value expression for the report parameter contains an error:The expression contains a non existing parameter in the report parameter collection. Any ideas to change the order Edit the XML File Thanks! I'll refer you to my previous answer in which I stated that you can't expect to put the WHERE clause back in and expect to retain the order. This is equivalent to putting back the dependency, you can'y do it and expect to retain ordering. Once again, parameters with dependency must appear in order of dependency otherwise you'll ...Show All
SQL Server Variable that maps to bigint in SSIS
Hello Which variable type in SSIS maps to bigint in SQL Server 2005 I am returning a single column value of type bigint from SQL Server and want to store that in a varible in SSIS, what datatype should I use I tried Int32, Int64, Uint64 and it did not work. Did I do something wrong Thanks This may sound goofy but the way I got it to work was to set the variable as a string. If you want to pass it in, you can pass it in as a long. The obvious one int64, doesn't fly for some reason. -- Brian Knight ...Show All
SQL Server Aggregation functions in Calculated Measures displays wrong values.
Hi, I think this calculated measure implementation is making me absent minded, so if this seems like a silly question, please ignore my behaviour but do answer to my post :-) I will ask this question with a sample data: consider that the cube consists of School Children's names as the first dimension (school_children) and date(jan, feb....) as the second dimension. the measure (M) is the 'exam scores' of the school children. jan feb mar school_children M M M ----------------------- tony 50 20 40 bony 10 40 40 mony 60 60 70 Now when i add a calculated measure where I want to display the avg marks of each. so in the calculated measures formula I add: Avg([Measures].[M]). (This is ...Show All
Windows Forms DataGridViewRow - why does it require a default property?
This code in VS05 : Private Sub ProjectGrid_CellClick( ByVal sender As Object , ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles ProjectGrid.CellClick Dim currentProject As DataGridViewRow = ProjectGrid.CurrentRow Debug.WriteLine(currentProject( "ProjectID" )) End Sub ProjectGrid is a DataGridView control bound to a bindingsource connected to a table in a dataset. ProjectID is a valid column name in the grid and the bindingsource. The user has clicked on a cell in the control to activate this handler. Produces this error in the debug.writeline statement with reference to the variable currentProject: Class 'System.Windows.Forms.DataGridViewRow' cannot be indexed because it has ...Show All
Visual C# Are objects inside ArrayList threadsafe ?
Hi, I am using framework 1.1 In my application I have a list of markets and various associated attributes, such as Current Price, MArket Open Time e.t.c I have created a class in which I have declared all market attributes for each market as data memebers. So if I have 12 markets then I create 12 objects of market class. I instantiate the class only at the beginning of the application and used some of its memebers for look-up purposes and others I have to update constantly, such as last market price. I keep all these 12 objects in an arraylist. In my application I have on thread that gets the last market price. I am updating the "LastMarketPrice" member of Marketclass on this thread. All other calculations are bein ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Direct input initialisation errors
i can't figure direct input out, i've read prety much every tutorial i can find, and at the end of the day i've narrowed it down to one error: c:\ (filepath) : error C2065: 'hWnd' : undeclared identifier this is being generated by my initialisation function here: if (FAILED(lpdikeyboard->SetCooperativeLevel(/*missing identifier for hWND, no idea why*/hWnd, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) { /* error code */ } does anyone know how i should be declairing hWnd in order to get it working here because it's used in other functions in exactly the same way without any errors. many thanks Hi, have you checked the DirectX input tutorials that come with DirectX SDK hwnd is the handle to the window th ...Show All
Visual C++ Beginner question - ExitInstance()
Hello all, I have a very basic question: How does one go about overriding your app's ExitInstance() function I'm using VC++ 2005, so I tried right-clicking on the app class in the Class View , selecting "Add->Add Function...". Of course, I know the function name ("ExitInstance") and I know I need to select the "virtual" check box, but I don't know the return type, and the parameter list should be empty but the "parameter type" list box doesn't contain such an option (i.e. I must pick a parameter type). Anyone Thanks in advance! ...Show All
SQL Server Setting width of parameter text box?
Is there a way to set the width of the parameter text boxes in the Report Server UI As luck would have it, I need it to be just a few characters wider. Thank you, Dick Campbell No, if you mean the textboxes shown above the report at runtime to gather user-entered parameter values. These elements are drawn by the viewer control, and are not affected by anything in the report definition file, other than to enumerate how many to draw. ...Show All
Visual C# generics: T Create<T>() where T : MyClass, new(...)
Is there a way to enforce a non default constructor And if not, why not ! I wrote a class that implements a constructor that is in need of an XmlDocument as a parameter. Several other classes inherit from this base class. Now I would like to write a generic create method that instantiates one of the child classes and sets some base properties: class MyClass { public MyClass(XmlDocument xmlDoc) { ... } public ElementName { get { .. } set{ ... } } } class ChildClass1 : MyClass { ... } class ChildClass2 : MyClass { ... } class MyClassFactory { ... public T Create<T>(XmlDocument xmlDoc) where T : MyClass, new() { T myClass = new T(xmlDoc); ... } ... } Obviously that does not work because the generic all ...Show All
.NET Development How to fire the javascript function in href attribute
Hi, I'm writing a test tool for a website. It has a treeview created in javascript. Each child node has a check box and is expandable. Expandable has <a> tag with href javascript function. <a id = id1 href = dosomething(param1, param2);"> Now I'd like to fire this event for this id in order to populate the child nodes. But I don't know how to do that. Could anyone help me in this Any information/pointers are much appreciated! Thanks Like the other post alluded to, the following should work (works for me): <script> function doSomething() { alert("<a> tag clicked"); } </script> <a id="id1" href="javascrip t:doSomethin ...Show All
SQL Server Login failed for the user (using windows integrated security)
Hello Everyone, I am trying to connect SQL database through code but I get this error,I have spent days to solve it but unfortunately I couldn't...Here is my code in VB express(OP:windows 2000 with SP4)I am new to VB,so it makes the situation more difficult for me. my code is: Public Class Form1 Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load Dim conn1 As SqlConnection = _ New SqlConnection( "Data Source=.\SQLEXPRESS;" & _ "Integrated Security=SSPI;" & _ "database=deneme3_database;" ) 'Open connection conn1.Open() MessageBox.Show( "Connection succeeded." ) 'Close conn ...Show All
SQL Server Controls disappear
Is it not possible to execute one package and then design another package I am executing one package and trying to design another package and just have a grey window in the control tool box that says: "there are no usable controls in this group. Drag an item onto this text to add it to the toolbar" Can I only get my controls by dragging when another package is executing Where do I drag them from Thanks, Kayda Hi Kayda, The Visual Studio Integrated Development Environment (IDE) changes modes when the debugger starts. It disables most editing functionality until it exits debug mode. It also hides controls in the toolboxes. This is by design. Although the package execution is comp ...Show All
SQL Server Server: the operation has been cancelled. - when processing cube
When I highlight a few partitions and start processing, the process occasionally stops with a message that operation has been canceled, like this: Response 3 Server: the operation has been cancelled. Response 4 Server: the operation has been cancelled. Response 5 Server: the operation has been cancelled. ..etc... (no further error message details are provided) SQL profiler shows that batch was completed (but rowcount shown in process progress log is too small). Analysis Services profiler shows no messages at that time at all. It just shows messages when it started, and when I restarted the processing. The Analysis trace appears to be stopped when processing stops with " Server: the operation has been cancelled.&quo ...Show All
Windows Forms Visual Studio can only save and load arrays with a rank of 1.
I'm using C# 2003 and got this message: "Visual Studio can only save and load arrays with a rank of 1." I have a 2D array I would like to have as a design time property. Is this just simply not possible given the message If it is not possible, can I take this message to mean a 1D array is possible If a 1D is possible, is there any documentation on how to have a 1D array property that is editable at design time I'm assuming the message is from my 2D array, was this a good assumption Is this changed in 2005 thx. Sounds like it's nothing stupid I did, and the message is at least actually reflecting a lack of support. It also sounds like it's not fixed in the 2005 version either ...Show All
