DrFlick's Q&A profile
Visual Basic Select Case statement being evil
The select case statement is out to get me! Has anyone else run into the trouble of having a Select Case statement and one of the case statements has hit if you look at the data, but refuses to hit anyway That probably doesn't make sense... Put it this way... I have, say, a ListBox control that has three IP addresses in it. For argument's sake we'll say the three items are: 192.168.0.1 192.168.0.2 192.168.0.3 These items have the indices 0, 1 and 2 respectively. Now, inside a function that receives a string of data (T) from a network user I have code that's something like this: Dim X As Integer For X = 0 To (ListBox1.Items.Count - 1) Select Case ListBox1.Items(X) Case T 'Code segment 1 Case Else 'Code ...Show All
.NET Development Windows halts loop excecution
I hope this question is in the correct forum. Here is my problem. I have a generic while loop that is repeatedly calling a function. This function handles receives in socket communications. The problem is that windows will stop executing this loop. All of a sudden it will just pause. Once you force a refresh of the form that contains this loop (by minimize/restore, etc), the loop will start executing again and will never pause again. Initially, I thought it may have something to do with the socket communications. So, I replaced the socket function with just incrementing and displaying a variable. Sure enough, the display would start counting up. All of a sudden, it would pause. As soon as the form is refreshed it would start counting again ...Show All
Visual Studio 2008 (Pre-release) Help with styles
I seem to be missing something fundamental with styles. In the code below, see the Hyperlink cell template for the PublishDate column. When I apply the LinkDefault style, it works great for the first row, but after that all the other cells are blank for PublishDate. It does show an active scroll bar there in the cell , so something is happening, but it does not seem to be showing any data in any of the rows in the GridView except the first row. ------------------ <Window xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' Width="664.8" xmlns:l="clr-namespace:SDKSample" x:Class="SDKSample.Window1"> <Window.Res ...Show All
SQL Server Log Shipping, more than one database
Hi Folks anyone could provide steps, links, on how to bring secondary online, with more than one database being log shipped thx Toni, It seems that you have two questions - how to bring a secondary online and how to ship more than one database. You can bring a secondary online applying the tlog backup with recovery. To ship more than one database, you just specify them all when configuring log shipping (right click database properties and select log shipping tab). Regards, Matt Hollingsworth Sr. Program Manager Microsoft SQL Server ...Show All
.NET Development Updating a field in a table
I'm looking to update a field in a table in my MS Access database. I'm creating a rental program so when the item is returned it will insert the date that the item was returned. At present the field(date_returned) does not have anything in it. This is the cose i have at present: Public Sub Add(ByVal cdr As String) sql = "UPDATE Rentals SET date_returned = @date_returned WHERE cd =" & cdr Try If conn.State = ConnectionState.Open Then conn.Close() End If Dim command As New OleDb.OleDbCommand(sql, conn) command.Parameters.Add("@date_returned", Date.Now) conn.Open() command.ExecuteNonQuery() conn.Close() 'MessageBox.Show("", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch ex As Exception End Try End Sub At the underlined line i'm ...Show All
Visual Studio Team System Graphically Displaying Build Results
Hi, Just wondering if anyone knows of a way of displaying build results graphically e.g. a pie chart that shows the number of failed and successfull builds. I don't think TFS has this functionality built into it but something someone else has created would be useful. Cheers, smudie I don't know of anything either, but I would guess you could use the TFS report functionality to do this. If you want to explore the use of TFS reporting, please post a question in the reporting forum. Buck ...Show All
Visual C# Collection Differences
I want a collection for dynamically adding/removing/sorting lists of strings. From what I can tell, the best options are List and StringCollection, but what I can't tell is what exactly the difference would be. They both seem to have many of the same methods, and in the documentation they are both used as examples of Collections that are not prone to performance hits (at least, for my usage). If anyone could explain to me what the difference is, and why I might prefer one to the other, that would be greatly appreciated, as right now I'm very confused, and don't want to start using the wrong one only to have to find that out a while into the programming! Thanks very much! Thanks to both for the reply ...Show All
.NET Development Referencing Assemblies Through Code
How can I reference an assembly through my code, I don't think it can be part of a project, this is related to my previous thread about 3 days ago, but I prefer to keep different questions in different threads. Anyways, Upon running my game, it will build a .exe, from the contents of a .cfg file, I need the .exe that it outputs, to be able to reference my main Game, I need it to be able to change variables and stuff, they are mostly all set to public and what not... Two ways to do this. You could let your main form generate events, install event handlers when you load and initialize your dynamic assembly. Or have a class in your assembly implement an interface. ...Show All
Visual C# viewing processes in C#
I need to keep track of what is running on my system. I used to do it via various APIs like pview.exe , cmcmd.exe , pulist.exe , tList.exe , Rlist.exe etc. They are very inconvenient for many reasons. Now I want to do inventory of the processes running on the system with C# code. I am sure it would be much simpler. My question is: what Classes should I take to do it. Thanks. boban.s wrote: Did you tried ProcessExplorer from sysinternals and from lately microsoft sysinternals. This app rocks, so here is the link. : http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx If you have posibility to download presentation of some of sysinternals by Scott Hanselman where you can see some ...Show All
Visual C++ error LNK2005: _main already defined
I recently installed VC++ 2005 EXP edition. 1) I created a project name Radius and created two new items hello.cpp and area.cpp. 2) area.cpp is the first item and hello.cpp is the second one. 3) When I build the project Radius, I got the error LNK2005: _main already defined in area.obj Can you guide me to fix the compilation error. Thanks GKW82 This is what MSDN says : Error Message '{' : missing function header (old-style formal list ) An open brace occurs at global scope without a corresponding function header. This error can be caused by an old-style C-language formal list. The following sample generates C2447: int c; {} // C2447 Check whether you are ...Show All
.NET Development XML program
please tell me what is working area of xml language.where this is widely used. Hi, Please refer my post in the following link, Hopefully it will give you idea about what you want. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1185958&SiteID=1 HTH, ...Show All
Smart Device Development AVRCP
Any help in finding documentation on how to use AVRCP in C# CF 2 appreciated :) thanks a lot, it was a great help. however, http://msdn2.microsoft.com/en-gb/library/ms879577.aspx is referring me to a sample application in Folder: \Bluetooth\BluetoothEvents, i checked my C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32 and it has no such folder in it. all I have in my bluetooth folder is btsearch. I also downloaded and installed SDK again, with the same result. do you know why the sample is missing Cheers, Shafa ...Show All
Windows Forms PrintPageEventArgs Supplies a Graphics Object with Random VisibleClipBounds
I am facing a problem where only a portion of the page I am trying to print shows up on the printer. I see that the same problem is reported by a number of people: a. http://www.thescripts.com/forum/thread225516.html b. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=38324&SiteID=1 c. http://www.dotnet247.com/247reference/msgs/24/121201.aspx After spending some time, I find that the Graphics object supplied by PrintPageEventArgs in the PrintPage event is giving a "random" VisibleClipBounds. For the same printer, sometimes it is big enough for the page, sometimes it is not. In one debug session, I printed my application to different printers one after another by selecting them from a standard PrinterDialog I ...Show All
Visual Studio Express Editions PS
Maybe it's not C#, but whatever it is, it's not familiar to me. What I want to do is to type in something like "ostream" and have it take me to an appropriate page. I did manage to naviagate to the MSDN help system (although I've already forgotten how I did that). But it did not come up with a search box or a useful index. Things are organized by categories, like input and output. I really am impressed with C++ Express. And the price literally can't be beat. But I must say, for a decade, every time MS improves a product, the help system becomes more difficult to navigate. Sigh. I hate when I finally understand someone's post after I've made a complete fool of myself demonstrating my lack of understanding in public ...Show All
Visual Studio Express Editions Programming a button to directly open a .exe file!
I am making a program that will open a file when you click a button. I don't need to access the open dialog, I would just like to click the button and the .exe file opens. I am burning a bunch of programs to the same cd so i have to be able to open the one specific program and only that program with that button. I am trying to open this file with the button: "IE7-WindowsXP-x86-enu.exe" So if I had a button and I clicked it and it directly opened that file that is exactly what i am looking for. If anyone could give me a hand that would be great!! ahmedilyas wrote: Dim theDriveLetter as String = Application.StartupPath.SubString(0, 3) Process.Start(theDriveLetter & " fileName.exe " ...Show All
