
pendragon
Avatar/Signature-
Posts
214 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by pendragon
-
I think the new row command is just for adding a new row and should not be needed on an edit, I did a test using the program in your zip, this is all I added to your program Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim CurrentRow As DataRow CurrentRow = Me.DsTest1.Tables("Customers").Rows(Me.BindingContext( _ Me.DsTest1.Tables("Customers")).Position) With CurrentRow .BeginEdit() .Item("CompanyName") = Me.TextBox2.Text .EndEdit() End With OleDbDataAdapter1.Update(DsTest1.Customers) End Sub I don't think that you can change a primary key this way. When I first tried your program after downloading, I looked to see if there where any records to update before doing the .Update command and it came back with nothing so i don't think that databinding is changing the row state. The above should. Sorry I'm not much help but I don't use dataBinding myself (or ADO.NET as I prefer the old ADO :D)
-
I think this thread will help http://www.xtremedotnettalk.com/showthread.php?t=83912 At the bottom there is also a link to a tutorial that he has done.
-
The following link will take you to a page where someone has written the old MaskEditBox that was in VB6 for .NET. Maybe this will work for you. http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp?target=maskedit
-
Change in form size based on the display resolution
pendragon replied to Ananda's topic in Windows Forms
you can use the scale method for the form to scale down. -
As long as the project Participants have a link back to the project then you should be able to do this be adding a group for the Project Number. Group Header would print the number and title Details would print the Participants Group Footer would print the contracting name.
-
AlexCode No need to be sorry, if not for your "out of the head" idea I would still be trying to sort this. Anyway it might work, I stopped looking as soon as I found WaitForInputIdle :p
-
Hi AlexCode Thanks for your reply. As they say �Its good to talk�. I started to search for ways of passing references for controls between process and within 5 Minutes I found the Process.WaitForInputIdle Method, this will do what I want. :D Have posted the code below so you can see what I have done and thanks again for your help. private void RunProgram(string programtorun, LinkLabel theLinkLabel) { Process MyProcess; string ProgramToRun = Application.StartupPath + "\\" + programtorun.Trim() + ".EXE"; if (File.Exists(ProgramToRun)) { theLinkLabel.Enabled = false; MyProcess = Process.Start(ProgramToRun, AuthoCode); MyProcess.WaitForInputIdle(); theLinkLabel.Enabled = true; MyProcess.Close(); MyProcess.Dispose(); } }
-
Hi AlexCode Thanks for your reply 1) I must admit I was hoping there would be a lazy way to do it, O'well can't have everything so will do it that way. 2) Unfortunately at the moment It does need to be able to run a program more than once, If I manage to change there minds on this then I will use that method thanks.
-
Hi all I have two, hopefully quick, questions 1) I am writing a project that has a standard form layout that all forms inherit from, each form is designed to fit in the smallest screen resolution that we run (800 x 600) and on start-up to position itself in the centre of the screen, on the machines that are higher than this (the highest is 1280 x 1024) I want to scale up the forms to make them more readable. Now I can do this using the Scale command for the form and I have a routine for increasing the font sizes, but what I don't want to do is change all my programs and add this call to all the forms but instead put the call in the standard form layout that I am inheriting from. Now the question is where in the standard form do I put it, If I put the call in the Initialise Routine it runs the code but then overrides it and shows it as normal, if I put it in the Activated or Load events it does the scale but centres it on the old size not the new :confused: 2) After logging in they are shown a Main Menu, each option is a Link Label that when pressed will run the program attached to it, I do this using Process.Start as I need to pass parameters to each program. Some of the programs gather a lot of data before they show anything and can take upto 10 seconds to load depending on the speed of the machine. What I want to do is when the Link Label is pressed I disable it, start the process and only enable it again when the program is running. Can anyone give me some ideas on the best way to do this? Thanks
-
I have a class that I use for locking controls, clearing fields etc. I do something like this. for (int index = 0; index < this.Controls.Count; iIndx++) { switch (formName.Controls[iIndx].GetType().ToString()) { case "System.Windows.Forms.GroupBox": GroupBox groupBox; groupBox = (GroupBox)this.Controls[index]; for (int index1 = 0; index1 < groupBox.Controls.Count; index1++) { switch (groupBox.Controls[index1].GetType().ToString()) { case "System.Windows.Forms.TextBox": TextBox theControl; theControl = (TextBox)groupBox.Controls[index1]; theControl.Clear(); break; } } break; } } But this can get complicated depending on what you what to look for (ie groupbox's in groupbox's)
-
Hi dynamic_sysop It used to be EMPLOYEE.JPG, this is just what it has ended up as after an hour of trying to get it to work.
-
I have a strange error that I can't figure out, I have a form with a picture box and a button on it, when you press the button it should load a picture into the picture box but for some reason I always get the error An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.drawing.dll Additional information: C:\A the code in the button is this.pictureBox1.Image = Image.FromFile("C:\\A"); the file does exist and if I use an openFileDialog to select the file then it works. What is going on :confused: :confused: :confused: Thanks
-
MS Access auto-incrementing primary key
pendragon replied to ballisticnylon's topic in Database / XML / Reporting
If you have Access 2000 or Later and version 4 of the JET OLE DB provider then you should be able to use SELECT @@IDENTITY with the dataadapers objects RowUpdate event. This wil return the last Auto number generated. If you search for "Retrieving Identity or Autonumber Values" in the help it will give you an example -
date format oledb command => ms access
pendragon replied to Stijn's topic in Database / XML / Reporting
I use the DateValue Function in the sql statement so that it takes into account the International settings. ie dbo.tblImportCCD.CCDDatum > DateValue('" & DateVariable & "')" This should sort out both problems -
Don't know if you can use this but I had a problem login onto an Access database with database level password. I defined the following as program level variables. ReportDocument crReportDocument = new ReportDocument(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); Tables CrTables; then in my viewer load I did this crReportDocument = new ReportName(); crConnectionInfo.DatabaseName = "DataBase path and name"; crConnectionInfo.Password = "Password"; CrTables = crReportDocument.Database.Tables; foreach (Table CrTable in CrTables) { crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); } Hope this Helps
-
I download the code to have a look but as I have not done anything with api's yet I am unable to find the problem. However, I don't know if this will help you, When I was running the program if I start it, selected a line in the first listview, Pressed edit, press update, then select line in first listview again, press edit, press update, I now press a key and I get the error, this happened everytime and it did not matter what had focus. Hope that gives you an idea of where to look.
-
This is what I have to do to connect to an Access database with database level password ReportDocument crReportDocument = new ReportDocument(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); Tables CrTables; crReportDocument = new ReportFile(); crConnectionInfo.DatabaseName = "DataBase Path and Name"; crConnectionInfo.Password = "DataBase Password"; CrTables = crReportDocument.Database.Tables; foreach (Table CrTable in CrTables) { crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); }
-
In your button code Dim frmUpdater As New frmUpdater Me.Hide() frmUpdater.ShowDialog() Me.Show()
-
At the moment I am still using ADO but have been looking into changing to ADO.NET later, I have a book that I am going through and it has a small section on doing what you want. It says on the OrderID DataColumn set the AutoIncrementSpeed and AutoIncrementStep to -1, when new orders are added they get order numbers -1, -2 etc., When you add your order lines the OrderID on the Line needs to be set to this number. As long as you have a DataRelation setup, then by default, when you save the sales order header the DataRelation will cascade the changes through your DataSet and give you the right OrderID for your header and Lines, then when that is done you should be able to save your order line details. As I say, I have not tried this yet but everything I have tried so far from this book has worked.
-
me.hide() f.ShowDialog() me.show() If you use f.show then when the form has been shown the program will continue executing the function and will show itself again.
-
I Would be interested to know what your program is doing, I had a similar problem with a program that navigated around a recordset that then setup other recordsets and showed the information on a tabcontrol. If the user pressed the buttons too fast I got the error, ended up having to turn off the buttons do the work and show the results then turn them back on. Never did find out what was causing this, but as I found a work around, the user didn't really notice anything only a flashing button text and there seemed to be no other problems with it, I left it alone (If it aint broke don't fix it sprang to mind) as dead line was fast approaching. I think something was jumping into the message queue at the wrong place and being run before it should have, but as I said I didn't find out so could be completely wrong.
-
Thanks Heiko, that will do it
-
I Schobert Thank you for your reply Under C#, I beleve that when you add a variable in the constructor for a form you have to specify the form name for it to work, don't know of anyway around that so Unfortunately this will not work, unless someone tells me differently of couse, as I am not an expert In C# or OO programming.
-
Hi In the project I am writing there are some data entry forms that can be called from different parts of the program. One of these screens can be called in over 140 projects so I decided to try and create a componant class that inherits from System.Windows.Forms.Form. What it does is to allow the user to change the processing date for the program, it has 2 buttons (Accept, Cancel) and a textbox on it. I can get it to come up by doing the following AskDate.Date askDate = new AskDate.Date(); askDate.ShowDialog(); What I don't seem to be able to get my head round is how to pass back the contents of the textbox when the user presses accept. I have declared a ref variable in the construtor to pass in the variable that I want change but I don't know if I can do variableA = variableB as a ref copy in the class code. So my question is Am I going about this the right way and If yes how do I pass back information to the calling program. All Help/Advice is gratefully received :) Thanks
-
DiverDan Did microsoft say which virus it was as all our machines have an anti-virus system on them that is updated at least once a week if not more often when big virus's come out. All of the machines also have SP4 on them and are updated with microsoft patches when they come out.