|
I am recreating a program originally written in Foxpro, which is nearly complete. I am running into a design problem causing me some grief. Basically the program is a form connected to a database displaying the fields in texbox. The original Foxpro program saved the changes made if the person moved out of the textbox, or tabbed out. Pretty convienent for them, and they are used to that. The Foxpro update is almost instant.
Ok mine has an update button, takes about 9 seconds for the adapters to update. If I tie this into any control it will take that long. I know that the design is different, but is this what I am stuck with ? I know nothing of Foxpro but it seems it is updated just that one field and mine is updating everything ? Mine is updating like this...
dataset1.Update(ChangedRows)
|
|
|
|
|
You could try using the OleDbCommand instead of the DataAdapter for your update. You will have less overhead. Also Dataset1.Update updates the whole DataSet which takes more time then updating one table row using OleDbCommand. Not sure how much of a difference this will make. 9 seconds seems like along time - is the database server being over worked?
I'm a long time FoxPro programmer switching to VB .Net and I can say in your example FoxPro will always be quicker because in FoxPro the table is already opened and at the correct record. In VB .NET you have to make a connection and send the update command.
|
|
|
|
|
It should not be updating the entire dataset, just that one adapter. I am using something like this.
dataadapter1.Update(ChangedRows)
I figure it close to 8 seconds. I tried to shorten the update statement, that did not seem to help any at all. Your question about the database being overworked ? Nah, I am the only one on it and the server is rather robust. I did borrow this code from someone maybe it is at fault ? This is in the update subroutine.
'Create a new dataset to hold the changes that have been made to the main dataset.<br />
Dim objDataSetChanges As BA_Application.DataSet1 = New Application.DataSet1<br />
'Stop any current edits.<br />
Me.BindingContext(DataSet11, "customer").EndCurrentEdit()<br />
Me.BindingContext(DataSet11, "inventory").EndCurrentEdit()<br />
Me.BindingContext(Dataset11, "orders").EndCurrentEdit()<br />
'Get the changes that have been made to the main dataset.<br />
objDataSetChanges = CType(DataSet11.GetChanges, Application.DataSet1)<br />
'Check to see if any changes have been made.<br />
If (Not (objDataSetChanges) Is Nothing) Then<br />
Try<br />
'There are changes that need to be made, so attempt to update the datasource by<br />
'calling the update method and passing the dataset and any parameters.<br />
Me.UpdateDataSource(objDataSetChanges)<br />
DataSet11.Merge(objDataSetChanges)<br />
DataSet11.AcceptChanges()<br />
Catch eUpdate As System.Exception<br />
'Add your error handling code here.<br />
Throw eUpdate<br />
End Try<br />
'Add your code to check the returned dataset for any errors that may have been<br />
'pushed into the row object's error.<br />
End If
-- modified at 13:08 Thursday 17th November, 2005
|
|
|
|
|
rem out this line
DataSet11.Merge(objDataSetChanges)
|
|
|
|
|
hai,
I am using Rich Text box control for displaying the status in my project.when the text exceeds the control's size i can't able to see the status .Is there is way to always focus at new entered text position.
with Thanks and regards,
P.Gerald Manickam
|
|
|
|
|
Please let me know how to get height , width in pixel of screen in VB net
Thanks
|
|
|
|
|
|
HI,
I request to send the real defination of com and dcom with small example in VB.
Also features of COM and DCOM is needed to me.
thank you
Paritosh
|
|
|
|
|
This is a prime example of the sort of question that is trivial to answer yourself with the help of google. You want to know what COM is, that's not a programming question, it's a 'I can't be bothered searching myself' question.
For what it's worth, when you inevitably get some 1 votes, I didn't vote on this post.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
Can any body tell me how to read and write a text file in VB.Net
Thanks in advance,
|
|
|
|
|
|
|
Hi,
i have made a form which follows the following logic :-
The form displays various panels which are used to get criterias from the user. then form.layout is suspended and the following algorithm executes :
1. Based on these criterias i add various column to a datatable say dtRecordsReturned.
2. Then datagridcolumnstyles [some of them are instances of classes i inherited from datagridcolumnstyle] are made and added to a datagridtablestyle , which is then added to the TableStyle property of a datagrid say dgRecordsReturned.
3. the dtRecordsReturned is then bound to a dataview dvRecordsReturned.
4. dvRecordsReturned is bound to the dgRecordsReturned.
5. then records(rows) are added to dtRecordsReturned by executing a sqlQuery.
6. Then Values of some of the columns of each row are set according to the criterias got from the user. While doing this some special conditions may arise, which i am displaying to the user by setting an errormessage on that particulare column by calling .SetColumnError(columnname,strSpecialContidionDescription).
7. then the panel [pnlRecordsReturned] which contains dgRecordsReturned is brought to the front by calling pnlRecordsReturned.BringToFront().
8.Finally the form.Resumelayout() is called.
Now the Problem i am facing is that though the ColumnErrorIcon is displayed in the columns, no tooltip message pops up when the cursor is hovered over the icon.
I tried using .RowError instead of .SetColumnError still the result is similar. ErrorIcon appears in the rowheader but no tooltip message pops up.
Any Suggestions?
Thanks
|
|
|
|
|
hiya, i am new to .NET.I am required to use .NET to do my project. Hope the people here can help me the following questions.
1:When begin,what codes should i added first?
2:What is the code for the link control from a web form to another?
3:How to connect to microsoft access?
4:How to make the buttons to scroll the info?
5:How to make the data to be read according to the link topic under the same database?
Thanks
|
|
|
|
|
Wow...
rei ayumi wrote: 1:When begin,what codes should i added first?
....
rei ayumi wrote: 2:What is the code for the link control from a web form to another?
<a href="page2.aspx">Goto Page 2</a>
<asp:hyperlink id="Page2Link" runat="server" navigateurl="page2.aspx" />
rei ayumi wrote: 3:How to connect to microsoft access?
4:How to make the buttons to scroll the info?
5:How to make the data to be read according to the link topic under the same database?
Seems to me you don't even know the basics... I'd suggest you get a book...or 12....and read some tutorials, or follow by example, lots of great code on this site.
|
|
|
|
|
rei ayumi wrote: 1:When begin,what codes should i added first?
Whichever you think should be added first! Given you question it seems you are a begginer, I would suggest writing a small part of the UI and use that to get data out.
rei ayumi wrote: 2:What is the code for the link control from a web form to another?
Not sure what you mean by this!
rei ayumi wrote: 3:How to connect to microsoft access?
You need to research a technology called ADO.NET: it is built into the .net framwork and provides a way of connecting to most common databases. You might also want to google for "LINQ to SQL" and Entity Framework for options based on ADO.NET
rei ayumi wrote: 4:How to make the buttons to scroll the info?
Depends, but normally you don't, the scroll appears when the data is too large to fit. Again, I'm not sure I understand your question.
rei ayumi wrote: 5:How to make the data to be read according to the link topic under the same
database?
It is impossible to tell you exactly how to do this, it depends how you are getting your data. With pure ADO.NET you query the database using the link topic to filter via an SQL WHERE clause. With LINQ and Entity Framework you can write a LINQ query to do the same job. The details depend exactly on which technology you use, what and how you want to filter.
Hope this helps.
[Edit]
Though the help is late, I didn't realise that I was not on "Page 1" of the forum and was answering a 5 year old question. If you do invent time-travel, go back and inform yourself that ADO.NET is your only option until 2007 IIRC.
|
|
|
|
|
Hi,
I'm designing a form without a title form. To move the form around, I have to write another simple mouse_move event that will get the location of the mouse pointer and will replace the location of the form. It works, but the thing is, when i tried to move the form around, it flickers. I tried to use the doublebuffering style, but it still flickers. Anyone know why this is or how to handle this kind of situation? Also, the mouse pointer is off by a noticable distance from the form.
Anyone, please help. I am a newbie here, so please show me your guidance.
Thank you
|
|
|
|
|
We can better help you if you post your MouseMove event code.
|
|
|
|
|
woops sorry
Here's my code
dim MDown as boolean = False
Private Sub FormaName_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If MDown Then
Me.Location = Control.MousePosition
End If
End Sub
Private Sub FormName_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
If e.Button = MouseButtons.Left Then
MDown = False
End If
End Sub
Private Sub FormName_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
If e.Button = MouseButtons.Left Then
MDown = True
End If
End Sub
With This code, I have problems with the flickering and the pointer of and also with the pointer. Try it and you'll know what i mean, I'm not good at explaining :P
Thank you
-- modified at 11:54 Wednesday 16th November, 2005
|
|
|
|
|
I tried your code and didn't see any flickering. But I did see problems with the form dragging code. Try this.
Private m_isMouseDown As Boolean = False<br />
Private m_lastMousePosition As System.Drawing.Point<br />
<br />
Private Sub FormName_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown<br />
If (e.Button = MouseButtons.Left) Then<br />
m_isMouseDown = True<br />
m_lastMousePosition = Me.MousePosition<br />
End If<br />
End Sub<br />
<br />
Private Sub FormName_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp<br />
If (e.Button = MouseButtons.Left) Then<br />
m_isMouseDown = False<br />
End If<br />
End Sub<br />
<br />
Private Sub FormName_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove<br />
Dim formPosition As System.Drawing.Point<br />
<br />
If (m_isMouseDown) Then<br />
formPosition = Me.Location<br />
formPosition.Offset(Me.MousePosition.X - m_lastMousePosition.X, _<br />
Me.MousePosition.Y - m_lastMousePosition.Y)<br />
m_lastMousePosition = Me.MousePosition<br />
Me.Location = formPosition<br />
End If<br />
End Sub
|
|
|
|
|
It's Workingg Thanks a lot
For the flickering problem, i think it appears because i was using it as an mdiChild of another form. Also, I have so many controls on the form. Coz when i tried that code with a single form, it works just fine. Any idea how to handle this problem?
|
|
|
|
|
Hmmm... I still can't reproduce this flicker issue, even in an MDI app. Perhaps my PC and video card is too good?
Does it flicker when your child forms have borders too?
|
|
|
|
|
OO, I know why. Try create an image for your background and use it as backgroundimage For your MDIContainer, you'll get the flickering effect
|
|
|
|
|
Okay. Now I'm seeing something.
I can seeing a painting issue while I'm dragging the child window.
Try this. Put the following code at the bottom of your MDI child form's constructor (the Sub New method).
Me.SetStyle(ControlStyles.DoubleBuffer, True)<br />
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
|
|
|
|
|
Hi,
I already have that in there but it's still doing it. Is it because the background image keeps painting everytime we drag the child window? Is that what is happening? If it is, is there a way to stop the background image to stop refreshing?
|
|
|
|