Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
i am trying to close second form from its class
Nerseus replied to Xenocaster's topic in Windows Forms
Can you give us some more details about the two classes and what's not working (a compile error, runtime error, or just not working as you think it should)? If you can zip up the code that would be best. -Nerseus -
The Tooltip can also be added to a form like any other control. It will show up in the yellowy part below the form's designer. It's an Extender control so it adds properties to ALL controls on your form. If your ToolTip object is called toolTip1 (the default), your controls (in the designer) will have a new property called "ToolTip on toolTip1". You can also use the toolTip1 object in code, just as you are (toolTip1.SetToolTip(ListView1, TextBox1.Text). -Nerseus
-
If I understand your question, you have one solution file with 25 projects and there are many project references between projects. And you'd like to open just one of the project which currently has project references but be able to open and run it without actually opening the full solution (and all 25 projects)? There is no way that I know of if you use the same project file. The project stores the references. That means they must be Project OR File, but not either/or. I haven't tried this, but you should be able to create a second project file that uses the same source files (maybe a different project name?), one has file references and one has project references. I don't know if that will work or not and you might have to play around a lot. What we've done is to use project references for only 2 or 3 projects when needed (for debugging to be able to walk through a referenced project). At some point you should be able to compile 24 of your projects into DLLs and use those references. By "some point" I mean when the referenced projects are stable enough that you don't need the ability to step into them. -Nerseus
-
So your current error is "Select command is not setup"? Set a breakpoint on the line that's causing the error and check the SelectCommand to see what it shows. If it is empty, you'll have to look back (you can use the CallStack) to see what code was called prior to your initialize and see where you think the Select Command was being filled OR where it might be getting cleared. Without seeing your code, it's very difficult to guess what might be clearing out the Select Command. -ner
-
I wonder why you wouldn't just bind both textboxes to the one datasource? I haven't tried to duplicate your code, but it sounds like a bug (if two of you can get the same odd behavior). I'd write or call MS if you think it's a bug and they can tell you yes, no, or it's a "feature" not a bug :) If you have MSDN you get at least one free support call. You can use that to find out what's going on. Otherwise the calls are around $100 each (I haven't called them for a few years). -Ner
-
Like I said, I think your best bet is to redesign how you're storing your information. If it really is file information, why not store the whole version number as one string or as 4 numbers. If you store things as multiple columns in one row it's MUCH easier to piece together than multiple rows into one column. Who's building and filling your database? If it's you, I'd re-do the table structure. If it's someone else... well, have them do - it looks like a bad design from what I can see. -Nerseus
-
Your error message says it all: Message Queuing has not been installed on this computer. And yes, it's a windows option. -Nerseus
-
Is it possible to view Command Text passed to the database?
Nerseus replied to Wutime's topic in Database / XML / Reporting
Whoops - better use SP:Starting instead of SP:Completed since your proc is having errors and might not complete :p If you'd like to see EVERY line that the proc is executing (say your proc does 3 SELECTs, an INSERT, and a DELETE), use SP:StmtStarting. -Nerseus -
I'm not sure what you're trying to do. You say: I'm confused because your function takes two params and returns a new Size. You only mention passing one value and getting back a new value. I haven't looked at your code, but are you just trying to resize an image? Why not just multiply the width and height by the *same* value? If you need to base that scaling factor based on a maximum height or width (the second param maybe?) then you just need to figure out which dimension (width or height) is bigger and get your scaling value from that. If that's all you need, I can give you my 3 or 4 line version. -Nerseus
-
Yes, but not easily. To combine multiple rows into a single field separated by commas requires writing a cursor to get the data for each child row. You can loop through each row, add the commas, and add it as a string column to the parent resultset. You can simplify it by putting the cursor in a user defined function (in SQL Server), and using that function in your SELECT, passing in the File_ID. Now, if you have control of the child table and know that there will always be 3 versions, you could re-create that table to have 3 columns (version1, version2, and version3). Or, if you need them as separate rows, add another column like Sequence: Table 2 File_ID Seq Version F001 1 1 F001 2 2 F001 3 3 F002 1 1 F002 2 2 F002 3 3 Then you could join to the child table 3 times (using an alias for each join), and use the sequence to grab each of the three rows. That would allow you to have 0, 1, 2, or 3 rows and piece them together in one column. This would limit you to a max of 3 rows (or whatever you define the max to be), but can't be dynamic (you can't easily allow 4 rows later - you'd have to change your proc). If you want dynamic, you'll have to use the cursor. -Nerseus
-
Is it possible to view Command Text passed to the database?
Nerseus replied to Wutime's topic in Database / XML / Reporting
The only way I know of to test this, Wutime, is to use the Sql Profiler that comes with the SQL Server tools (like Query Analyzer). Start up the profiler then: 1. File->New->Trace 2. Make your connection to the server 3. In Trace Properties go to the Events tab and add the event "SP: Completed" When this starts, you'll see a bunch of messages flow by. You're looking for the lines "SP: Completed". It shows the SQL Query, be it dynamic SQL or a stored proc call, including all params. -Nerseus -
Why would you call Clear then Update? I don't see how the Update would do anything since you just cleared the DataSet? Maybe you want Clear then Fill and leave out the Update line... -ner
-
First, do you know what Message Queuing is? It's a relatively advanced topic and you should probably do some reading before trying to do a multi-threaded, message enabled application. Your first problem is that you don't have Message Queueing installed. It's a Windows option so you'll have to go to Add/Remove Programs and select Add/Remove Windows Components. I think it's available on WinNT, Windows 2000 and XP Pro, but not much else. If you read the standard windows help on message queuing, it can explain what transactional queues are and how you can use them. It won't explain why you'd want to necessarily as that's generally left up to you to decide what technology is best. Now, if you just want a queue type of object look in System.Collections for the Queue class. -Nerseus
-
I have no problem with it being in the way - it appears below what I'm typing, You can stop it by pressing Escape while typing or disable it completely through Tools-Options-Text Editor-<language>-General-Auto list members. Seems an awful waste of one of the best features of Visual Studio though... -Nerseus
-
I've only read the last half of this thread, but I hope this helps :) The following link shows a way to see what's closing your form (code, the X, windows shutting down). It relies on what I think is a hack, but has been consistent on every machine I've tried. Just a suggestion if nothing else works: http://www.codeproject.com/useritems/FormClosing.asp -Nerseus
-
How can you be sure you have one row? Can you show us how you fill the DataSet? Also, use dsCRH.GetXml() to see all the data in your dataset. If it doesn't show anything, you have no data. You definitely want row 0, btw. All collections/arrays/etc. in .NET are 0-based. -nerseus
-
Navigate through 3 different .NET-Datsets ?
Nerseus replied to Mischamel's topic in Database / XML / Reporting
I'd get all the data in one DataSet, 3 separate DataTables. You can define relationships in a DataSet between your parent/child tables. If you bind correctly (check the help on binding parent/child tables or relationships), moving a row in one table will automatically update the binding in the child table(s). You could also do what you want manually. Hook an event to the currencymanager (I think, I can't remember which object/even you need - it's positionchanged I think). When the position in the parent table changes, you could create a filtered DataView on your child table and bind your textboxes (or whatever) to that. If you need a third level, hook to the first child's position changed event and ... well, you get it. You might very well be able to do what you want without writing any special filtering code - I'd check out the DataBindings collections and remember that you can bind to a DataTable, DataView, and a relationship (which might be what you want/need). -Nerseus -
Actually, if you want a SUM per Class and Subclass, use this: SELECT t1.CDClass, t1.CDSubclass, SUM(t2.ElapTime) FROM Table1 AS t1 INNER JOIN Table2 AS t2 ON t1.NumericID = t2.NumericID GROUP BY t1.CDClass, t1.CDSubclass The Group By is the key - it defines a grouping so that you can run aggregate queries on columns, such as the SUM() above PER a column (or multiple columns, as shown). You'll have to use the table.column name syntax in the select since some of the columns repeat between tables (it's genereally a good idea to use table.column names in a SELECT instead of just column name). -Nerseus
-
Leaving the connection open or closed?
Nerseus replied to wyrd's topic in Database / XML / Reporting
Keep in mind you're only sharing connections on the same machine for Access (sharing works on SQL Server as described). This is different than connection pooling, which is what COM+ provides for you. If you have two people connecting to SQL Server, they may share a connection (if the strings are exactly the same), but they're not pooled. Also, there are valid reasons to keep things disconnected (get rid of the connection as quickly as possible) and reasons for keeping a connection open. For now, I'd suggest closing the connections as quickly as possible and filling datasets to be used client side. I wouldn't worry about keeping connections open for now as there use is more limited (but still valid!). -nerseus -
Displaying currency fields from Access to vb text box
Nerseus replied to vbnewb's topic in Database / XML / Reporting
You can use the Format and Parse events of your DataBindings collection to automatically format data. Here's a code snippet to setup the binding. Check the help on how to code the Format and Parse events - they contain sample code to convert numbers back and forth so that you can type "1,234,999" and it will convert it to "1234999" so that the database won't cause problems. textBox1.DataBindings(0).Parse += new ConvertEventHandler(CurrencyStringToDecimal_Nullable); That's C# syntax. For VB, I think you'll want to use AddHandler but I don't know the syntax. Check the help for the Format or Parse event and all will be revealed :) -Nerseus -
I didn't get the NullReference, but I do get the Windows menu problem you're talking about. It's as if the Windows menu "eats" the first click - just doesn't respond. By the way, it only appears to happen if your child forms have menus. My original sample project didn't have any menus on the child forms. If you take off the main menus from your child forms you'll notice the Windows menu working as expected. Oddly enough, the select and popup events fire on the window marked as the MdiList, it just doesn't show the list. You might be able to do that manually to get around the bug for now. -Nerseus
-
I'm guessing you have no selected row so trying to reference row 0 isn't valid. You'll have to check to the number of selected rows bofore using that code. -Nerseus
-
You only need to call Dispose if you showed the form using ShowDialog. If you just used form.Show(), you don't have to call Dispose(). -Nerseus
-
Be careful when using the DialogResult property on buttons. They can create a cascading effect if you have multiple modal forms layered on top of each other. To see what I mean: Put a button on a form and set it's DialogResult to anything but None. In the button's click event, create a new instance of you form and show it modally. Now click the button repeatedly to show multiple modal windows. Click the X to close the topmost form (you shouldn't even be able to click the other forms). You'll see that ALL of the modal windows close, one after another. What this means is, if you have a SAVE or OK button that sets the dialog result, and inside the click event you determine that the user hasn't entered something and decide to NOT call Close, you must ALSO remember to manually set the DialogResult to None to prevent the form from closing - even if you never run this.Close() (or Me.Close in VB). In my opinion, you might as well just set the DialogResult yourself in code (it defaults to Cancel so you don't have to worry about changing it in a Cancel button or if the user clicks the X). -Ner
-
Squirm was saying that you can change the values of your x and y loop variables inside the loop, to fit your needs, if you really need to change the values (it's generally not a good idea). If we knew *exactly* what you wanted (change the value of x or y OR change your "if condition = true" logic), we could offer more concrete help. If you really mean to assign x the value of 2 in the loop, you could write: for x=0 to 10 for y =0 to 10 if condition = true then array (x+1, y-1)=T array (x, y- 2) =T x = 2 end if next y next x or maybe you want: for x=0 to 10 for y =0 to 10 if condition = true then array (x+1, y-1)=T x = 2 array (x, y- 2) =T end if next y next x -Nerseus