David Anton's Q&A profile
Visual Basic Auto Primary Key with fill in
I want to setup a int primary key that auto increases but will fill in any missing numbers EG 1 2 4 5 7 The next primary key should be 3 (NOT 8) SQL Server 2005 VB.NET 2.0 How do I make the sql server do this, so that the data is safe from corruption / data loss. David Scherf wrote: How do I make the sql server do this, so that the data is safe from corruption / data loss. YOU DON'T ...Show All
Windows Forms icons on command buttons
Hello! Can anyone please explain to me how can I assign icons to command buttons, in order to make them look more intuitive When you want to use an Icon as an Image, you create a new instance of the Icon object, passing the path to the icon as an argument, and then call the ToBitmap() method of the Icon to get an image. eg. Dim ico As New Icon("c:\test.ico") CommandButton1.Image = ico.ToBitmap HTH ...Show All
SQL Server Finding the Max Value
I have a report that is grouped by week. The details of the week have the date, time interval (half hour), and the maximum value for that day. So in the example below I am showing the week of May 21st. Then I have all of the days of that week, sorted by date as requested, with the halfhour the maximum value occured in on that day. So Monday the 22nd has the maximum value for the week at 254 (and is highlighted in red). Where the are below, I need to display '1400' which is the interval, but have not yet been able to figure out how to do this. I tried the following expression: =iif(max(Fields!MaxValue.Value) = Fields!MaxValue.Value, Fields!Interva.Value, "X") but this only works if the first day is the maximum value. ...Show All
Visual Basic setting variable values to an index value to be used in an array
I am reading through an open textfile and assigning values from the file to variables with the following code: FileOpen(intFileNum2, strSamFile, OpenMode.Input) Do While Not EOF(intFileNum2) Input(intFileNum2, intSamNum) Input(intFileNum2, intYear) Input(intFileNum2, intDist) Input(intFileNum2, intSubDist) Input(intFileNum2, strSource) Loop The strSource values that are input are either an "R" or a "U As the file is read I need the strSource values to be indexed for an array such that: "R" is recognized as a 0 and "U" is recognized as a 1. Is there a way to reassign a value of 0 to "R" and 1 to "U" while it is reading through the file T ...Show All
Internet Explorer Development IInputObject no longer called in IE7?
Has the behavior around IInputObject changed for IE7 We're doing the standard: 1. On SetSite(), get the IID_IInputObjectSite from the IUnknown parameter. 2. When one of our UI Windows gets or looses focus, call IInputObjectSite::OnFocusChangeIS() It all appears to work; however, we never see callbacks on our IInputObject methods: UIActivateIO, HasFocusIO, TranslateAcceleratorIO. Well, that's not completely true. We see a callback on IInputObject:: UIActivateIO(FALSE..) when a second, different toolbar calls IInputObjectSite::OnFocusChangeIS(FALSE), but that's the only time (we see it in the stack crawl). Is this behavior different from IE6 This bandobject needs these calls to do it's UI correctly. It's more complex than a simple editbox ...Show All
.NET Development Data provider could not be initialized
Hello, I'm using OleDB provider to connect Access 2003 database. My connection string is: "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDb.Mdb" After my application is executing about 200 commands one by one I get the following error: System.Data.OleDb.OleDbException: Data provider could not be initialized. Unspecified error at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection own ...Show All
Visual Studio Printing Issues
Hello, I’ve been having this issue for a couple of weeks now and have tried countless ways to find a work around without much luck. Long story short, I’m writing an application with Visual Studio 2005 Professional using J#, the application has a user enter data such as name, address, phone, etc and then a Submit Button. I want to print a form with this data, and I have created a separate form that gets populated with this information and is sized to fit an 81/2 x 11 piece of paper. The print solutions that I’ve found in the Help section and on these forums have a lot of flaws for what I’m trying to accomplish. The answer I’ve found is to do the screen capture – and that works some times, the problem is, the form doesn’t comple ...Show All
Internet Explorer Development strange behavious in IE ActiveX control used from .NET
I am using IE ActiveX control in my C# app. I want to prevent links that would normally open a new explorer window from doing so (I'm talking about links with target="_blank" and "_new") This is how I init this part of the control: SHDocVw.WebBrowser_V1 wb = (SHDocVw.WebBrowser_V1)this.axWebBrowser1.GetOcx(); wb.NewWindow += new SHDocVw.DWebBrowserEvents_NewWindowEventHandler(wb_NewWindow); private void wb_NewWindow(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Processed) { Processed = true; axWebBrowser1.Navigate( url, ref objNull, ref objNull, ref objNull, ref objNull); } This works! You can read more about what I'm doing here: http://support.micros ...Show All
Visual C++ How to access a program ported from C from other .net project?
Hi, I am pretty new to C++ .Net and I need help on how to let my .Net programs accessing functions ported from a C program. What I have now is a solution that contains two projects. The first is a C++ .Net class library project and the second is a VB.Net project (doesn't have to be VB, it can be any other .net languages). What I need is to have the VB test program call functions from the C++ program. The C++ project is created by porting an existing C program. What I did was that I created a class library project using the C++ wizard. Then I added my existing C program (without any change at all), MyLib.c, into the project and removed all those generated files that I don't need. After fixing some issues, now I have the project co ...Show All
Software Development for Windows Vista CreateDirectory failed in the ActiveX control when logged in as guest
In my activeX control, it will create a "pref" folder in user profile folder, like c:\Users\guest\AppData\Roaming\MyCompany\pref , to store user's preference setting. It works fine when user log in Vista as administrator, the folder and file are created successfully. But if user log in as guest, the CreateDirectory function will be failed, ant returns "Access Denied" error. The same activeX control works fine on Windows XP, no matter user log in as administrator or guest. Is there any security setting changs in Vista caused this error My ActiveX control is created by ATL in Visual Studio 2003.net, and this activex is loaded from a IE. Thanks a lot! I may be wrong, but Ap ...Show All
Software Development for Windows Vista AutoCAD 2007 and 2005 compatibility with Windows Vista
My bussness revloves around the use of AutoCAD. I recently installed Windows Vista Ultimit on my computer. After i tried to install AutoCAD 2005 on it to discover it would not work. Is there any patches in order to make it compatible. If not Is AutoCAD 2007 Compatible before i go and buy it. thank you Thank you a lot for sharing your experience, I'm really glad to know that so I don't have to run AutoCad 2007 from Virtual OS! Thank you ...Show All
Windows Forms Display multiple fields in a DataGridView cell
Hi All! How do I display multiple fields (1 line per field) in a DataGridView cell (more like ASP .NET's repeater or GridView's ItemTemplate capabilities)... i need to display it like below: Cell1 | Cell2 ------------------------------------------- ID | Desc Name | Other Field Address | etc. ------------------------------------------- ID | Desc Name | Other Field Address | etc. -------------------------------------------- Any help will be very much appreciated. You asked already this 2 days ago: The best aswer was from Zhi-Xin Ye. " Use virutal mode and use the CellValuesNeeded" Here is the link to the original post http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1197954&SiteID= ...Show All
SQL Server Using Management Studio to manage .sdf file on device
Hi, I am trying to connect to a database on a Windows Mobile device using the Management Studio. I am able to select server type "SQl Server Mobile" and navigate to the file on the device. When I try to connect I recieve the following error. Should this work If so what must I do to allow the registry access Thanks, Ron Requested registry access is not allowed. (SQL Server Mobile Edition ADO.NET Data Provider) ------------------------------ Program Location: at Microsoft.SqlServerCe.Client.TdsParser.ThrowExceptionAndWarning() at Microsoft.SqlServerCe.Client.TdsParser.Connect(String host, SqlCeInternalConnection connHandler, Int32 timeout) at Microsoft.SqlServerCe.Client.SqlCeEngine.FileExists(String filenam ...Show All
Visual Basic passing a function's name to another function (or sub)
Dear all when programming in FORTRAN I was used to pass the name of a function to another sub or function. With VB.NET I have some problem. Suppose I have several functions, named F1,F2, F3,.., and that I have to perform some common task on these functions (for instance numerical integration). Well, I wish to manage things in such a way to have a library function or subroutine (to do integration) and to call it passing various parameters 'and' a function name ( e.g. F3 ) to perform the integration of F3 . In other words I wish something similar to this fragment of code to work (declarations and initialization omitted): module main integ1= integration(a,b,step,F1) integ2= integration(a,b,step,F2) end module m ...Show All
Windows Forms Maximum number of controls on a form
Is there a maximum as to the number of controls that can be on a form I have a tab control on a form with seven tabs and at least 50 textboxes on each tab and the IDE seems to have trouble handling it. Thanks, cj Well, although it is discussed before, I'd like to make some summary since the thread looks out of order. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=770632&SiteID=1 I think there IS a limit on the maximum number of the controls because the system has the a limit number for GDI handlers. This value is stored in registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current Version\Windows\GDIProcessHandleQuota DONT change this registry value greater than 16, ...Show All
