|
Good day everyone,
I need to update a record into the database Access via table adapter in VB.net 2005.
The dataset is updated, but the record in the database Access is not.
Could anyone knows how to fix this problem?
Please help.I'd appreciate it so much.
Thanks
(Student_Details:table name)
MyDataSet.Student_Details.Rows(2).Item(3) = "new password"
MyDataSet.GetChanges(DataRowState.Modified)
Student_DetailsTableAdapter1.Update(MyDataSet)
MyDataSet.AcceptChanges()
Me.Validate()
Me.Student_DetailsBindingSource.EndEdit()
Me.Student_DetailsTableAdapter1.Update(Me.MyDataSet.Student_Details)
-- modified at 11:11 Saturday 14th October, 2006
eric
|
|
|
|
|
How can i create file that contains Text and Picture in it...
And than read in vb.net picture in picturbox and text in text box and if something is changed than save it...
|
|
|
|
|
I'm writing an app in VB.net with .NET 2. The application has a main form plus two other forms. When I click Exit-button on the main form, I call Me.Close(). After that MainForm_Closing routine handles the shut-down procedures. Ultimately I call Application.Exit(). The problem is that although the main form dissapears, application (.exe) keeps reserving system resources (95%!). How to close the application completely? I think the problem is that the two other forms are not closed, but hidden.
|
|
|
|
|
on your form put button "Exit" in exit buton type like this:
Private Sub cmdEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEnd.Click<br />
Me.Close<br />
Me.Dispose<br />
End Sub
and if you have to save anny data before closing, do it in "Form close event"
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing<br />
'Saving data<br />
System.IO.File.Create(Application.StartUpPath+"\data.ini")<br />
End Sub
------------------------------------------------------------------
Just be shure that u dont type on some other button which is suposed to end aplication that you type "End". Allways use "Me.Close"
------------------------------------------------------------------
Hope it helps! :->
|
|
|
|
|
Are you holding an unmanaged resources open that you should have Disposed? Started any threads that you didn't stop? Used a COM component that you didn't shutdown?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Usually Application.Exit() is enough to close the process completely. If not, try to close all other forums with the .Close method.
|
|
|
|
|
Not exactly. If you leave running resources, like a thread not set as Background, it'll stay running and visible in TaskManager, regardless of how you exit the app.
If you don't do anything like this, leaving unmanaged resources orphaned, then Application.Exit will do what you expect it to.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
My application is very simple, so I _think_ I haven't open any additional resources. MidiOutOpen is called when main form is loaded, but I close that in the MainForm_closing event.
I'm a beginner and I don't know what are threads. Can you please explain me? Still, I can see that two threads are left open even though application should have been shutdown. How to close all threads? Are active timer components threads?
What does the "Me.Dispose" command do? It didn't help though.
|
|
|
|
|
re infecta wrote: My application is very simple, so I _think_ I haven't open any additional resources.
Even the simplest of applications can have the biggrest of problems.
Since you're using a Midi library, you're more than likely using unmanaged resources.
re infecta wrote: MidiOutOpen is called when main form is loaded, but I close that in the MainForm_closing event.
You might want to check with the documentation of this library to see if your shutting it down properly. You can Open and Close it, but is this the correct procedure for using it??
DOn't worry about threads. If you didn't launch any, and you'll know if you did, you don't have the responsibility of managing them.
Don't do Me.Dispose . That tell's the current object, more than likely your form, to kill itself! This MAY be the cause of your problem...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What is the difference between the following :-
Application.Exit()
Me.Close
End
in ending a program.
|
|
|
|
|
|
Hey,
I was developing a program to edit shell icons and I had a reference list of what all the icons each code was for (i.e. 15 = My Computer). Anyway, I noticed that there were a few codes that's values were unknown, like: 14, 41, 42, 45 and 46. What shell icons are these?
And also, I was thinking of creating my own Dll file that holds pre-made shell icons (just like Windows' Shell32.dll). How do I go about compiling a Dll file to hold icons like that?
Thanks allot!
-- modified at 0:57 Saturday 14th October, 2006
|
|
|
|
|
I'm using Microsoft Visual Basic 6.0.
I'm doing my VB project to be handed in to my lecturer.
I have the following code in my VB project:
Open "D:\data.txt" For Input As #1
I want my program to display a messagebox if the file "D:\data.txt" is not found. How to do it?
|
|
|
|
|
This should work:
<br />
If My.Computer.FileSystem.FileExists("D:\data.txt") = True Then<br />
MsgBox("File not found")<br />
End If<br />
|
|
|
|
|
This won't work in VB6.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
First : imports System.IO
Then do this code:
if File.Exists("D:\data.txt") = False then
MessageBox.show("File not found")
End if
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
|
If ( Dir("D:\data.txt") = "" ) Then
MsgBox "Not Found"
End If
|
|
|
|
|
This code work for me. Thank you.
|
|
|
|
|
On Error Resume Next
Open "D:\data.txt" For Input As #1
If Err.Num > 0 Then
' Some kind of error occured opening the file...
Exit Sub
End If
' Continue on with processing the file...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey,
I am working on a program that will detect the keys that someone hits and having certain functions be called for those certain keys. I have been having trouble with the "enter" button on both Alphabetical and Numerical sides of the keyboard.
This is the code that I'm using:
<br />
If e.KeyChar >= ChrW(48) And e.KeyChar <= ChrW(57) Then<br />
MessageBox.Show(("Form.KeyPress: '" + _<br />
e.KeyChar.ToString() + "' pressed."))<br />
End If<br />
Select Case e.KeyChar<br />
Case "6" '6 (Right) key pressed<br />
Function1()<br />
Case e.Enter '8 (Enter) key pressed<br />
Function2()<br />
Case ChrW(49), ChrW(52), ChrW(55)<br />
MessageBox.Show(("Form.KeyPress: '" + _<br />
e.KeyChar.ToString() + "' consumed."))<br />
e.Handled = True<br />
End Select<br />
The "e.enter" is how the help file showed to do it, but it didn't work. Any ideas on what I'm doing wrong?
Thank you!
|
|
|
|
|
I'm pritty sure your in the KeyPress Event and you'll need to be in the KeyDown Event.
Select Case e.KeyCode<br />
Case Keys.Right<br />
Function1()<br />
Case Keys.Enter<br />
Function2()<br />
Case Else<br />
e.Handled = False<br />
End Select
And so one....
Hope this helps.
|
|
|
|
|
Sorry, but this raises errors.
Thanks anyway though!
|
|
|
|
|
I'm confused on how this would raise errors? If you don't mind explaining, so I don't make the same mistakes again.
|
|
|
|
|
These errors are raised:
KeyCode' is not a member of System.EventArgs
Handled is not a member of System.EventArgs
|
|
|
|