Software Development Network Logo
  • Microsoft ISV
  • Audio and Video
  • Visual FoxPro
  • SharePoint Products
  • IE Development
  • VS Team System
  • Visual Studio
  • Visual C++
  • Smart Devicet
  • Windows Vista
  • Visual Basic
  • Windows Forms
  • Game Technologies
  • Visual C#
  • SQL Server

Software Development Network >> Tony Han's Q&A profile

Tony Han

Member List

pavel989
pvphuc
Karenros
clueless in chicago
m_edmondson
Proram
uy777
Binu Jeesman
Evan Mulawski
DavidThi808
DBRICHARD
thukralz
ashk1860
Torpedoke
kubmg
Crasch
Zero_
SteveDee
programmer01
dork
Only Title

Tony Han's Q&A profile

  • SQL Server query with time period spanning two days

    I would like to run queries with data that sometimes span two days. The queries require start and end dates as well as start and end times. The following code works fine if the start time is less than the end time: select * from tst01 where convert ( varchar , [DateTime] , 126 ) between '2005-09-15' and '2006-01-27' and convert ( varchar , [DateTime] , 114 ) between '09:00:00' and '17:00:00' order by [DateTime] However, if I try to run a query where the start time is greater than the end time (e.g., start time 5:00pm on one day until 9:00am the next day), the query returns an empty table. select * from tst01 where convert ( varchar , [DateTime] , 126 ) between '2005-09-15' ...Show All

  • SQL Server Error 3154: The backup set holds a backup of a database other than the existing 'xx' database.

    HELP! This is happening with a restore to SS 2005 from a SS2000 backup. This article says to use the 'WITH REPLACE' clause. The SS2005 management studio does not seem to allow this via the GUI. http://msdn2.microsoft.com/en-us/library/aa238217(sql.80).aspx Did you use the overwrite flag in the GUI if the database already existed HTH, Jens K. Suessmeyer. --- http://www.sqlserver2005.de --- ...Show All

  • Visual Studio 2008 (Pre-release) Mapping both base and inherited objectqueries in objectcontext

    Hi! I'm experimenting some scenarios with Orcas october ctp. I would like to build an objectcontext with both base and inherited objectqueries. Example: I have two entities, Person, and Customer, which "is a" Person. Each entity has a table. Person has an Id, Customer a primary foreign key PersonId. These are the mapping files. These work without Customers EntitySet in csdl and corrisponding EntitySetMapping in MSL.   MSL: <Mapping xmlns="urn:schemas-microsoft-com:windows:storage:mapping:CS" xmlns:edm="urn:schemas-microsoft-com:windows:storage:mapping:CS" edm:Space="C-S">   <Alias edm:Key="C" edm:Value="ShopLib" />   <Alias edm:Key="S" edm:Value="ShopLib.Target" />   <EntityCo ...Show All

  • .NET Development Stored Procs, TableAdapters and parameters that don't map to a source column

    I'm struggling getting a Table Adapter to work with stored procs that have output parameters that do not map to a column in the datatable. Our DBAs have produced a set of standard SPs that all have a pair of final parameters that return error information. For example...(Definition truncated for brevity) CREATE PROCEDURE [dbo].[udp_Orders_Update] @p_Order_ID INT, @p_Customer_ID INT, @p_Status_ID INT, @p_timestamp TIMESTAMP, @p_audit_user VARCHAR(30), @p_err_no INT OUTPUT, @p_err_msg VARCHAR(500) OUTPUT My problem is that @p_err_no and @p_err_msg don't map to anything in the datatable. If I try to add/update rows to the DataTable and call the Update method on the adapter I get... Procedure or Function 'udp_Orders_Update' expects ...Show All

  • SQL Server Import\Export Wizard Feature?

    A new developer tried to import a data file using the Import\Export wizard. Unfortuantely, the file had several format errors and the process aborted after reading one bad line. (I imported it using a BIDS package with error handling. The file had 454 bad rows.) Are there any options in the I/E Wizard to log\skip errors but continue processing After all, the I/E Wizard is designed for quick-and-dirty use and if it can't "handle" erroneous data "gracefully", it is not a very practical tool. TIA, Barkingdog That's an interesting request - could you log it through the feedback site I can see a ton of difficult questions around how we would implement it to ensur ...Show All

  • Visual Basic How to switch to another application from mine

    Hi, I want to be able to switch to another already running application when a user presses a button on a main form. I can enumerate the running processes and see that the one I want is running, I can get its Window Handle. How can I switch to it. ahmedilyas wrote: you could also use the SetForegroundWindow API, I think they both do the same job Thanks for pointing that out.. you should use the SetForegroundWindow to activate another application. SetActiveWindow only works for applications in the foreground. My mistake. ...Show All

  • Visual C++ Working with Objects

    I have been recently starting to use oo objects so that I can use functions within them etc. But When I try and to reference the functions it tells me that I can't do that because it is not any such function. I have arrays of these objects so I try and access they by using the code for example... _blocks :: IsFilled() So when I try and compile this it says that there is no such member of global namespace. Blok.h #pragma once enum _colour { LBlue,BlueRed,Green,Yellow,Grey,Pink,Null }; class Blok { private : int _IsFilled; _colour Colour; public : Blok( void ); int Set_IsFilled( int yesno); int IsFilled( void ); int Set_Colour(_colour CColour); ...Show All

  • SharePoint Products and Technologies Passing the Excel parameters to the backend

    I can define parameters in Excel Services, but I couldn't find any directions on how to pass those parameters to the back-end SQL Server relational database. Our users may see different set of data depending on their position. The Asia manager isn't allowed to see New York data for instance. I need to identify the user currently viewing the Excel sheet, and pass it's name as a parameter to the SQL server, so that SQL will filter out the data that the user isn't allowed to see. Is there an article out there that shows how to pass parameters to an SQL data source from Excel Services OK, this would work in a Windows Auth scenario. Unfortunately, we're not in an environment where we can implement ...Show All

  • Windows Forms Updating Textboxes.

    How do I update a text box with new information everytime an action is made see for example.. the program that Im creating removes ip addr that does not have a hostname.. but for some reason the new textbox doesnt want to update with the new ip addrs.. :( here is what I got. void ReLocateControls() { txt = new TextBox(); txt.Location = new Point( 10, 340 ); txt.Size = new Size( 770, 30 ); for( int x = 0; x < pnl2.Controls.Count; x++ ) { CheckBox chk = pnl2.Controls[x] as CheckBox; chk.Location = new Point( 10, 30 * x ); IPAddress[] ipHostEntry = Dns.GetHostAddresses( chk.Text.ToString()); foreach( IPAddress addr in ipHostEntry ) { txt.Text += addr.ToString() + &q ...Show All

  • Visual Studio Express Editions Matrix implementation problem

    Hi everyone, I am implementing a matrix program which create matrix according to the values on a file and write to or read from files the values of the matrix. However, since I am not able to compile my program, I would like to ask you that whether my class si logically correct and whether it gives a compile time error or not. If there is unexpeted situations in my code, would you please help e to fix them class SymmetricMatrix { public: int index1; int index2; int **matrices; /* * Constructor that initializes an empty matrix with a given size. */ SymmetricMatrix(const int matrixSize){ size = matrixSize; matrices = new int*[size]; for(int a = 0; a < size; a++) matrices = new int[size]; // assigni ...Show All

  • Smart Device Development Can't make CeRapiInvoke work c#

    Hello I'm using CeRapiInvoke to invoke a method from a library i've created and copyed to device. That library has a class with a static method that return the DeviceUniqueID. When i try to use CeRapiInvoke i doesn't work. I'm lost in here and would apreciate some help. To invoke it i'm using this code: [DllImport("rapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] internal extern static int CeRapiInvoke(string pDllPath, string pFunctionName, uint cbInput, ntPtr pInput, out uint pcbOutput, out IntPtr ppOutput, IntPtr ppIRAPIStream, uint dwReserved); public object invokeLibrary() { string sDllPath = @"\Windows\GetDeviceID.dll"; string sFunName = "DeviceID.GetDeviceID"; u ...Show All

  • .NET Development Using UpdatedRowSource with a Transaction

    Hi all, I my current project, I have the following situation. We have a SQL Server 2000 database where some of the tables have primary key field that is set as an Idenity columns (i.e generates it's own keys) On the client application we use and ADO.Net dataset to retrieve and store data. Whenever rows are added to one of those tables, a pseudo key is created on int the client Data and we use the UpdatedRowSource to retrieve the actual value when the data is inserted in the database. The tables are most of the time part of a multitable dataset, so the updates are done in the correct order (delete childrows, delete parent rows, update & insert parent rows, update and insert childrows) to avoid referential integrity problems. These ...Show All

  • Visual C++ whats problem with this code? msvs2005

    hello, it's my first post here, i have little problem, i'am trying to build minimal executable, but i can't, the main problem is 'unresolved external symbol _memcpy' main project options is /NODEFAULTLIB, enabled intrinsic-functions and changed entry-point to WinMainA here it my simple code which reproduce error: #include <windows.h> // Constants struct _TEST { char test1[256]; char *test2; int test3; }; // Main code void _test(_TEST *tst) { ZeroMemory(tst,sizeof(_TEST)); tst->test3=666; } int __stdcall WinMainA() { _TEST mmm; _test(&mmm); ExitProcess(mmm.test3); } ps. this code successfully compiled on msvs2002-2003, please, help me to solve this, thanks We're on the same page. I think the list you give, along ...Show All

  • Visual C++ tabs in mfc

    i want ot use a tabbed view in a mfc mdi project. i used CFormView and CTabCtrl, but from what i could find in the documentation i can make new tabs but i can't add a resouce to them like i'd do with a proprietypage, and all it did was add tabs at the top of the window, but nothing more. how do i solve this www.codeproject.com/tabctrl/mditabs.asp ...Show All

  • Visual Studio Export to PDF programaticaly

    I have a heavy report with graphs When rendering to PDF it runs out of memory any way to make it render directly to a file Hi, I'm using virtual earth in my application and need to export map in pdf or some other foramt. If anyone knows how to do it, please share your thoughts with me. Regards, Milind ...Show All

©2008 Software Development Network