Vaish's Q&A profile
SQL Server Difference between dates in different rows...
Hi all, I have a table named Orders and this table has two relevant fields: CustomerId and OrderDate. I am trying to construct a query that will give me the difference, in days, between each customer's order so that the results would be something like: (using Northwind as the example) ... ALFKI 25/08/1997 03/10/1997 39 ALFKI 03/10/1997 13/10/1997 10 ALFKI 13/10/1997 15/01/1998 94 ALFKI 15/01/1998 16/03/1998 60 ALFKI 16/03/1998 09/04/1998 24 ... At the moment, I have the following query that I think is on the right track: … SELECT dbo.Orders.CustomerID, dbo.Orders.OrderDate AS LowDate, Orders_1.OrderDate AS HighDate, DATEDIFF([day], dbo.Orders.OrderDate, Orders_1.OrderDate) AS Difference FROM dbo.Or ...Show All
Visual C# convert string to int
how can i convert hex string to integer for example string hxStr = "C" then int i = 12. Thank you best practice: int theResult = -1; if (Int.TryParse(" String ", System.Globalization.NumberStyles.HexNumber, new System.Globalization.CultureInfo(" CultureName "), out theResult) { //successfully parsed the string into an integer and result is stored in theResult variable } I believe this is available from .NET 2.0 ...Show All
Visual Studio Express Editions Issue with Option Strict and use of Exponent
New to the World of Programming in general, and new to VB. With thta stated I am having a bit of an issue with VB, since I am new to this I am not sure why the following code has issues: Public Class Form1 Public Sub Form1_Load( ByVal sender As Object , _ ByVal e As System.EventArgs) Handles Me .Load Dim Base, Power As String Dim Result As Integer Base = InputBox( "Enter a Base Number" ) Power = InputBox( "Enter Power Number" ) lblBaseNum.Text = Base lblPowerNum.Text = Power Result = CInt (Base) ^ CInt (Power) lblPowerResult.Text = Result.ToString End Sub End Class Speci ...Show All
Visual Basic Save data from a listbox to a .CSV file.
Hi, I am pretty new to Visual Studio, but know enough about SQL. I am working on creating some applications with VB to access my SQL database. I created a listbox that is extracting some data from a table. I am trying to Save that data to a .CSV file, but I am having major issues. I would really appretiate it if someone could help me and explain why my code is not working. I used examples to get to this code, but lack of experience is helping me to get stuck at this point. Thanks!!! Code: Try With sdlgTextFile .AddExtension = True .CheckPathExists = True .CreatePrompt = False .OverwritePrompt = True .ValidateNames = True .ShowHelp = True .DefaultExt = "txt" .FileName = filename .Filter = _ "CSV Fil ...Show All
Visual Studio 2008 (Pre-release) The server has rejected the client credentials
Hi All Potential showstopper for me! I have a Windows Communication Foundation Service, with the following service config: < xml version="1.0" encoding="utf-8" > <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="MarketDataCustomBinding"> <security mode ="Transport"> <transport clientCredentialType="Windows"/> </security> </binding> </netTcpBinding> </bindings> <services> <service name="MarketData.Services.HolidayDataService"> <endpoint address="net.tcp://MLISDE07522:12001/NetTcpBinding/HolidayDataServ ...Show All
SQL Server How do I determine the IP number and TCP Port of a SQL instance
I'm trying to determine the specific IP address and the TCP port on which a SQL server is communicating. As far as I can tell, I can't use SMO for this, since I need a method that is compatible with both SQL 2005 AND SQL 2000. Is there a work around or can I use DMO Since my target is to be able to use this code against multipel servers, it would be nice to find the method with the least overhead possible. I would also like to avoid being forced to read registries remotely. -- Jakob Bindslet According to BOL (ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/smo9/html/6527388b-26b5-4ebb-8a52-0cf4415f9134.htm) the Microsoft.SqlServer.management.Smi.Wmi namespace isn't supported on SQL Server 2000 and below. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Which game works best with XNA software?
Hey, I'm not really a programmer, but I do have some knowledge of the C++ code. I'm trying to make a basic game for a graduation exit project and I was wondering if anyone could clue me in to what sort of game would be the easiest to make. I've looked at the tutorials, and they might be able to help me out, even though they aren't exactly what I'm looking for. I'm thinking somewhere along the lines of a Frogger, Galaga, or Helicopter type of game; something basic, but not pong. I only have about a month to finish this so if anyone has some insight or wants to help me out, repost here, or email me at megabeandip@aol.com. -Andrew Bean Thread moved to XNA Game Studio Express forum. Genera ...Show All
Visual C++ Function return values?
I just noticed that the "Autos" window does not show the values returned by functions. These did appear in VS6. Has this capability been lost, or is there some setting that needs to be changed in order to have the return values displayed Some function results do appear in the first line, but many do not. What kind of configuration, setup, or mis-set options would cause this I suspect this is yet another problem w/VS2005, but want to be sure. ...Show All
Visual Studio 2008 (Pre-release) app.config
I have a managed dll C# code that is called from non managed C++ using the COM wrapper. this code initializes a servicesHost for WCF Uri baseAddress = new Uri ( "http://localhost:8080/BOSDcm" ); Console .WriteLine( "inside StartListening" ); m_myServiceHost = new ServiceHost ( typeof (WCFBOSService. BOSService ), baseAddress); m_myServiceHost.Open(); this works fine if called from a managed code, because app.config is reading correctly. but in my case I supose because the unanaged code does not loads app.config I got an execption. my question is: How I can force to load app.config so the ApplyConfiguration methods will find the correct data thanks, Dani. ...Show All
Smart Device Development How to disable VK_TACTION default behavior for model dialog in MFC?
I'm writing an application for Smartphone 2005 in MFC. I have tried to use the following lines to disable VK_TACTION default behavior without luck, g_lpfn = (WNDPROC)SetWindowLong(m_hwndCB, GWL_WNDPROC, (LONG)ModelDlgKeyProc); SendMessage(m_hwndCB, SHCMBM_OVERRIDEKEY, VK_TACTION, lp); The default behavior for VK_TACTION is IDOK, which is so annoying. Using the similar code, I have no problem to disable VK_TBACK. Any help will be greatly appreciated. Thanks a lot in advance. -Lewis ...Show All
Visual Studio Express Editions How to pass data from a DataGridView to another form?
I have a DataGridView that contains a ButtonColumn. I want to be able to pass the data from the row the button is clicked to the form that is opened when the button is clicked. The names of the columns are Year, Set, Card Number, Number, and Condition. I have tried the following code, but I get a 'NullReferenceException was unhandled' for the line highlighted in red. Public Class Catalog_Form Dim TrackingList As New Tracking_List_Entry_Form Dim SelectedRow As Integer Dim SelectedYear As Integer Dim SelectedSet As String Dim SelectedCardNumber As String Dim SelectedNumber As Integer Dim SelectedCondition As String Friend WithEvents Catalog_FormDataGridView As System.Windows.Forms.DataGridView ...Show All
Visual Studio Express Editions the break operation
hello there, am trying to figure out how can i operate my brake command inside a nested loop, but i like that the break would also affect the outer loop. her is some example of waht am asking: private void button1_Click( object sender, EventArgs e) { //loop india for ( int i = 0; i < 30; i++) { //loop juliet for ( int j = 0; j < 30; j++) { if (j == 3 & i == 0) { // how can it be applied both on juliet and india break ; } //MessageBox.Show("I is now equle " + i.ToString() + " J is now equle " + j.ToString()); } any advise would be apriciated. thanks in advance Bad news… break only breaks you out of the nearest loop and ...Show All
Visual Studio Express Editions Reading a web page...
I have been trying to read from a Web page inside of a WebBrowser control. I can read the entire page code, but can not specify certain areas of the page to read, like a text box. I would like to be able to read just the text box in my web page and have it write the context of the web page text box over to my application textBox... This is the closest I've been, but I can not get it to work at all. It will do the "if ()" event, which is just a message box, but it will not copy the web pages text box contents to my application textBox. <input name="txtName" type="text" id="txtName"> in order to get that element, I would do this: HtmlElement theTextBox = this.theWebBrowserCont ...Show All
Windows Forms MSI installation via SMS that uninstalls previous versions
I'm trying to make a MSI packet which will uninstall all previous versions of this same software. I've found out that I should add property ALLUSERS=2 FolderForm_AllUsers = ALL and same product and update ID's but still can't get it work...What else should I do to make it happen thanks The UpgradeCode must be the same but the ProductCode must be different. http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/ ...Show All
Game Technologies: DirectX, XNA, XACT, etc. XNA Book ( In Progress )
For reasons I cannot exactly put into words, I’ve decide to write a (free) book about how to use XNA. It is defiantly a work in progress and thus far only includes two chapters and associated source code. I truly hope that my work is advantageous to some people out there. I am in part doing this as a practice towards writing technical documentation. I am not accomplished in writing instructions for other people that may not have the same level of technical skill sets as myself. I hope that with this book I learn a whole lot and more in that regard. Granted, if you are a diehard game programmer, what I have written is probably not for you, at least, not yet! Yet I would value your input. If you feel like c ...Show All
