coder2k's Q&A profile
Visual Basic functions : does return end code path?
Simple little question, just curious if calling return inside a function will end the code path for example function test (byval testvar as string) if testvar = "a" then return("you selected 'a'") ElseIf testvar ="b" return("you selected 'b'") End If 'some more code Return("some stuff") End Function So if I pass this function "a" will the function return "you selected 'a'" or will the code continue to execute after the if statement and return "some stuff" instead When a return statement is hit, the method will start it's termination process. If there is no finally block wrapping the statement, the method will immediately return. If a finally block exi ...Show All
Visual C++ Taking a C++ class...
I'm partway through a class on C++, and, naturally, we have a project due for the term. I'm a DJ by trade, and have an extensive record collection. The project I've chosen is to build and maintain a program that can keep track of my collection (based from the professors example idea of a CD collection). I'm doing fine with the original interface, menu, classes, etc. The problem I'm having right now is, where do I store the data I'm considering using an Access Database (since a) I have Access 2003, and b) I don't really want to do anything too complicated since this is just a school project). I don't know, however, how to write code to interact with the database. I've used SQL before when doing Cold Fusion programming, but not for an ...Show All
Software Development for Windows Vista Work Allocation Queues
I’m investigating the possibility of re-writing the workflow component of an existing system using WWF. The existing system (publication approval system) allocates incoming work to available users - the "case" is then visible in the users "New Business" queue. Once the user’s starts working on the "case" it progresses to the "Pending" queue. There are about 15 different user queues and also various global queues. The existing system is great except for some scalability problems and the vendor has recommended (due to volumes) we investigate an alternative. We have as many as 5000 active workflows at any point in time. What would be best method be to implement a user or work allocation ...Show All
Visual Studio Team System Performance Problem #2
We've got a project with 3200 objects. The project contains about 10 errors. When we attempt to double-click on one of the errors to bring up the file, Visual Studio will hang for anywhere between 3 and 10 minutes. The Task Manager shows 'devenv.exe' consuming about 90% of CPU resources for this entire time. We're using the RTM version of DBPro. Amos. Gert, The errors are below. I really appreciate your help on this. We are running into horrendous performance problems with our projects. Each project has roughly 3200 objects and is under TFS source control. Sometimes projects take 10+ minutes to load, sometimes deleting schema objects takes 5-10 minutes, closing a project can take 10+ minutes etc. ...Show All
Visual Studio 2008 (Pre-release) binding custom properties
Hi, im trying to create a custom control( SearchComboBox ) derived form a combo box. in a simple combo box i used : SelectedValue = " {Binding MNILanguageTypeId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged} " And it works. Now for my custom control, i want a property that does the same thing as the SelectedValue of a simple combo box. MyNewProperty = " {Binding MNILanguageTypeId, Mode=TwoWay, UpdateSourceTrigger=Prop ertyChanged} " The problem is I get the following error: {"A 'Binding' cannot be set on the 'MyNewProperty' property of type 'SearchComboBox'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject."} And this is my property: [ Bindable ( tr ...Show All
SQL Server trying to update my database...............
hello, i use the following code to retrieve the contents of the table present in the sql server to be displayed on a datagridview. SqlConnection sqlCN = new SqlConnection (connectionString); sqlCN.Open(); string selectCommandText = "SELECT * from test2" ; SqlCommand sqlCmd = new SqlCommand (selectCommandText, sqlCN); sqlCmd.ExecuteNonQuery(); SqlDataAdapter sqlDA = new SqlDataAdapter (selectCommandText, sqlCN); DataSet DS = new DataSet (); sqlDA.Fill(DS); DataGridView1.DataSource = DS.Tables[0].DefaultView; I use the cellContentClick event to modify the contents of dataGridView. Is it possible for me to update the table directly ie., updating the adapter or tabl ...Show All
.NET Development Rong in calculation !!
Hi I got a funy problem I could not solve look at following code and run : Dim S As Single = 2345.235 Dim D As Double = 3456.456 MsgBox(2345.235 * 3456.456) MsgBox(CType(S, Double) * D) Dim Dt As New DataTable Dt.Columns.Add("s", GetType(Single)) Dt.Columns.Add("d", GetType(Decimal)) Dt.Columns.Add("r", GetType(Decimal), "s * d") Dim R As DataRow = Dt.NewRow R!s = 2345.235 R!d = 3456 Dt.Rows.Add(R) MsgBox(2345.235 * 3456) MsgBox(R!r) after running u will find out : 8106201.5871600006 8106201.9584589843 8105132.16 8105132D as u can see non of each groups are same!!!! so , I ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Animation Keyframes return broken data
I'm using the content pipeline, and enhancing the mesh processor to attach animation information in the Tag, so that I can animate imported meshes. It seems that the animation keyframes return broken data when importing from .X files. They seem to duplicate the first key (with time and everything), and then fail to include the last key. This makes making an animated game challenging. Here is an example from an animation with 41 frames, ranging from 0.0 to 1.33333: In the .X file: AnimationKey rot { 0; 41; 0;4;1.000000,0.000000,0.000000,0.000000;;, 160;4;0.996917,0.000000,0.000000,-0.078459;;, 320;4;0.987688,0.000000,0.000000,-0.156435;;, 480;4;0.972370,0.000000,0.000000,-0.233445;;, 640;4;0.951056,0.000000,0.000000,-0.3 ...Show All
SQL Server Performance in SSIS
Hi: I've written new SSIS packages to do what DTS packages did and the performance I'd say is about 20 times slower. In this package, I have a loop that loops through different servers based on server entries in a SQL database. Each loop pumps 10 tables. The source query is set by a variable and the destination table is set also by a variable, since all this data goes to the same tables on the SQL server and the definitions are all the same on the source server (Sybase). It's still going and has taken about 12 hours to pull roughly 5 million records. The source query ends up being: SELECT *, 'ServerName' FROM SourceTable1 WHERE Date >= Date The 'ServerName' , the "sourcetable1" and the "Date" are all set ...Show All
Visual Basic VB.NET & MySQL
Okay, I am a complete newbie at this and I was wondering if someone could help me setup a connection in VB2005 to MySQL. I'm trying to write a piece of software that will store information on a centralized server so that it can be accessed from anywhere in our network. Can someone PLEASE help me. Thanks, QWERTYtech http://qwertytech.bounceme.net Aight the site is very helpful except for the fact that it doesn't give me full syntax to setup my Connection. It gives me the specific information for the type of connection that I want to make. But I'm not sure how to setup the full CONNECTION syntax. Also, I was wondering if you might know what commands & syntax to add information to a databas ...Show All
Visual Studio Express Editions Timeout Expired Error
Help! I've built a program with a data base, The 1st time I run it I receive a "Timeout Expired" error, The second time I do not get the error, the same thing happens when I deplopy to other machines. I've read all the post suggesting changing the CommandTimeOut = 0. My question is how do I code this into my program. I try this, came from the msdn site, didn't work. Public Sub CreateMySqlCommand ( ) Dim myCommand As New SqlCommand ( ) MyCommand.CommandTimeout = 0 MyCommand.CommandType = Commandtype.Text End Sub Thank for any ideas or help. IW Hey Bruno Yu, I not sure that the problem, here is the error message I'm getting -- Sql Exception was Unhandled -- Timeout expired. The timeout per ...Show All
Visual Studio Team System Collation conflicts in CTP6
I am am taking a SQL 2000 DB as the source for my SQL 2005 project with a SQL 2005 Developer Edition 9.0 for a target database. After the schema is imported to project I am getting a collation conflict, I then try to change the collation in project settings to the collation that is mis matching. This gets rid of the error so I am able to deploy but then after the deploy and a compare back to the database the schema was pulled from the collations are different. These errors were not occuring when I was using CTP5, but I was using SQL 2000 for CTP5. Are there settings I have to change or select, it seems it wants to change my collation when going from SQL 2000 to a 2005 project. Can you tell me the collation ...Show All
Windows Forms SQL with VB 2005
hi all i linked my VB 2005 project to a small database which i created. I have a listbox and 2 textboxes. In the list box i see the surname of the customer and in the two textboxes the name and surname. When you click on the listbox (any customer name) the 1st and surname appear in the 2 textboxes as they are linked. My question is when i try to change the name of any customer then stop my application and run it again, the name of the customer does not change. I followed the steps shown in the video for that on this website but no luck. Stopping my application doesnt save the changes :(..any suggestion will be appreciated. thnx ok so i created a button so i can put my update method there but sill no lu ...Show All
Windows Forms How to determine if a form IsDirty
Let's say you have a form with a bunch of text boxes bound to a binding source. The form also has a "Save" button which you want enabled only if the user has made changes. The Save button will call bindingSource.EndEdit() and will then instruct the dataset to update the database. Other than catching the text control's EditValueChanged event, is there a simpler way that applies to the whole form It would be nice if the binding source had a IsDirty property that is set to true prior to the EndEdit(). Thanks to a suggestion from Bart Mermuys, I've got an answer. private void dataNavigator_PositionChanged(...) { btnSave.Enabled = false; timer.Enabled = true; } private void timer_Tick(...) { i ...Show All
Windows Forms print panel
How can I print a panel in windows form which include many other controls regards You can draw the panel into a bitmap, then draw the bitmap onto the paper. Something like this: Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim bmp As New Bitmap(Panel1.Width, Panel1.Height) Panel1.DrawToBitmap(bmp, New Rectangle(0, 0, Panel1.Width, Panel1.Height)) e.Graphics.DrawImage(bmp, 0, 0) End Sub ...Show All
