Ian Wallace's Q&A profile
.NET Development How to check the existence of object in an arraylist?? - in Visual C#.net
Hi all, I have created one arraylist which contains no. of objects of a particular class. At the runtime i want to check whether a particular object is exists in the arraylist or not. I tried Contains method of arraylist. But it returns false. Can i check only the particular field existing in an object from an arraylist I m struggling for a solution for the past 2 days.. bt i didnt get the solution. e.g. // this property returns a arraylist which contains objects of 'Servicedetails' ulist = service.ServiceDetails; I am using a gridview which contains a set of service details. based on the selected item in the grid create a temporary object and assinging the values to the object and i am checking whether it is existing in the ar ...Show All
Visual Studio 2008 (Pre-release) Change rectangle property from code
Hi guys, i've got a rectangle i've drawn in a grid, how can i change its propertys from code, i think i need to build once or something, should i be using X:name or something...FindName, i'm a bit lost, thanks guys si < Page x:Class = " WPFpong.Page1 " xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml " Title = " Page1 " Width = " 800 " Height = " 600 " KeyDown = " OnKeyDownHandler " > < Grid Background = " Black " > < Rectangle Stroke = " White " Fill = " White " Margin = " 12, ...Show All
Visual Basic How to load service names into a combobox?
I have been playing around with the ServiceController class and I was wondering if there is a way to retreive a list of all the service names progmatically and add them to a combobox. I have not found any way to "get" a service name list without already knowing the names. I don't really want to type out a list a generic services. Hopefully it is something simple I over looked and just being stupid... Thanks in advance. sure. Add a reference to System.ServiceProcess and then do this.... Dim theServices() as System.ServiceProcess.ServiceController = System.ServiceProcess.ServiceController.GetServices() for each currentService as System.ServiceProcess.ServiceController in theServices Me.the ...Show All
Visual Studio Express Editions find maximum value that was input into text boxes
I have three text boxes and I would like to click a button and have the highest value returned to a fourth textbox. Thanks in advance for your help. Dim num1, num2, num3, high As Integer Integer.TryParse(TextBox1.Text, num1) Integer.TryParse(TextBox2.Text, num2) Integer.TryParse(TextBox3.Text, num3) high = num1 If num2 > high Then high = num2 If num3 > high Then high = num3 TextBox4.Text = Convert.ToString(high) ...Show All
SQL Server Computing field rows
Hi Guys Is there a way in order to compute field of rows in a table Example. I have Revenue field with 2 rows Revenue Row1 100000 Row2 200000 let's say I want to compute for Row1/Row2 How can this be done ...Show All
SQL Server How to combine MAx statement with specific search?
Hello everyone! I've got a table (of "Persons") with 2 columns: "Age" and "Name". I make a procedure that get the MAX of "Age" of the table, like this: SELECT MAX (p.Age) MaxAge FROM Persons p But I'll like to add a new column to my result table. That column corresponds to the "Age" of a person 'X'. 'X' is its 'Name' and i will pass it by parameter to the procedure. Something like this: SELECT MAX (p.Age) MaxAge, --The highest age of the table p.Age ConcretPersonAge -- The age of the person X FROM Persons p That should returns a single row result table with the max of all 'Age" and the 'Age' of the person 'X'. Anyone can help me to do this Thank you to everyon, and a ...Show All
Visual Basic WinXP Serial Port is not compatible with Win98 programs
Hi I have an old program which is built for Win98. When installing on WinXP, everything works fine except the communication via Serial Port. I think this is due to some timing problems or differences between WinXP and Win98. Also, when interfacing the RS232 port to an RS485 convertor, I realised that communication does not work very well. Again, using an oscilloscope, you can tell that it is because of timing differences in the Serial protocol(eg, the WinXp driver flags CTS inaccurately causing the receive and send stream to overlap). I would like to know if someone has encountered this problem before Also, is there any reason or writeup explaining this Is there any patch to allow the older Win98 programs using the serial port to ...Show All
Visual Studio Team System TF53010 NullReferenceException from "TFS Warehouse" source
Each hour there are two TF53010 errors in Event Log. Thanks in advance for help how to resolve the issue. ------------------- THE FIRST ------------------- TF53010: An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff. Technical Information (for the administrative staff): Date (UTC): 10/16/2006 7:32:35 AM Machine: SERVER Application Domain: /LM/W3SVC/3/Root/Warehouse-4-128054503400728648 Assembly: Microsoft.TeamFoundation.Warehouse, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727 Process Details: Process Name: w3wp Process Id: 5140 Thread Id: 884 Account name: DOMAIN\tfsservice Detailed Message: Micros ...Show All
Visual C# SQL DB or XML DB?
I have a (new patient) form which has lot of combobox objects, eg. nationality, gender, country marital status.. etc and all these objects are currenlly reading data from tables in SQL Server but I am not sure if that's a good idea specally when it comes to application performamnce so I though why I can't store data in XML file(s) located in on the network instead of SQL tables.. But before moving to the XML file option I just wanted to ask you as an expert about this option what do suggesst Well if you have many computers using the same application then its better to use SQL Server to store everything, since you can access it from anywhere and have everything "synced" so instead of Xml being stored locally, you would have dup ...Show All
Smart Device Development XML Serialization
I have a question about XML serialization. I am using Visual Studio 2005 and C#. I was able to create a program for a desktop that serializes my object into XML and then deserializes the XML to form the object. I was attempting to make a similar program for my SmartPhone. When I want to serialize an object for a desktop program, I have to put the [Serializable] tag before the class. But when I try this for the Mobile app, it doesnt work. I have added all the references and using statements. I was wondering if the Compact Framework 2.0 even included XMLSerializer. Help! ...Show All
Visual Basic IP! How to find a list of all Ip addresses of users on the same network
I am making a Vb.Net program which is basically a chat program; I am using TcpClients and listeners to connect 2 computers. I've gotten the first program that runs to attempt to search the network for another computer already hosting, then if it doesn't find a host it opens a tcplistener and hosts on a port and waits for a request. But I can't figure out how to get a list, or to manipulate and find the other ip addresses of network users. I need the ip first in order to attempt to connect to that ip to find out if there is a host on the port I am using, if not move to the next ip, if at end of list - host Am I going about this the right way, or is there an easier to way to attempt to find a host and its ip without trial and error ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Rendering based on distance and subsets
Hi, Im trying to find out two things about rendering based on distance. As i understand it the best way to render a scene is draw the objects closeset to the camera last and the same with the objects subsets. 1) Is the best way to check the distance of a subset from the camera to send a ray from the cameras position to the subsets position and use the intersect information for the distance 2) Is the best way to render the scene to build the list of objects inside the view frustum, sort based on distance and then render. Thanks for any help, -Dave A ray will be too expensive as you need only sort by the Z/depth distance. A sorting based on the “real” distance between the eye point and the object ...Show All
.NET Development Record Count
Hi, I am using Access 2003 and oledb and need to get a record count of a database I open. Here is the code: String strCurrDir = Application.StartupPath + strDir; String connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source= " + strCurrDir; OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connectionString); OleDbCommand connCommand = conn.CreateCommand(); connCommand.CommandText = "SELECT * FROM code WHERE codeid = 'IMPORTDATA' AND code = 'SNMSA5'"; conn.Open(); Is there a easy way to do this without having to loop through the result set Thanks, Mark hi can't you just use "select count(somefieldintable) from code where codeid=... " this will ...Show All
SQL Server How to supress/hide/filter Nulls or Nothing-s?
I have several columns with expressions that return Nothing under certain conditions: Example:=(IIF( Fields!solved.Value=False,IIF( Fields!TAT3.Value >120, IIF(Fields!TAT3.Value <144,Fields!Ticket.Value,Nothing),Nothing),Nothing)) As a result, I get tons of white/empty space, because 200 values were evaluated as Nothing and only 5 values/records were actual numbers. How can I supress this Nothing value Have tried a blank string (empty quotes) instead of Nothing So your code would be Example:=(IIF( Fields!solved.Value=False,IIF( Fields!TAT3.Value >120, IIF(Fields!TAT3.Value <144,Fields!Ticket.Value,""),""),"")) ...Show All
SharePoint Products and Technologies Sharepoint Search
Hi all. I have installed MOSS 2007 enterprise in a simple-server farm mode using a SQL 2005 backend, both servers are running 64-bit. Everything seems to be working correctly execpt for the search feature, which we will need to use. The help search works just fine in the help section, but every time I try to search the site it returns the following error: Object reference not set to an instance of an object. at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecu ...Show All
