|
|
Ok,
Ive come up with a solution to the problem.
In my save function, I modified it to:
<br />
Dim builder As New SqlClient.SqlCommandBuilder(SqlDataAdapter1)<br />
SqlDataAdapter1.UpdateCommand = builder.GetUpdateCommand<br />
SqlDataAdapter1.Update(DsCustomers)<br />
Which seems to solve the problem.
However, why doesnt the SqlDataAdapter wizard create the necessary add/update/delete commands? Is that a bug? I tried it again, on another table, and the wizard just says "there were problems trying to create the UPDATE command"
Strange
|
|
|
|
|
We are creating one porject as Desktop app with VB.NET .My problem involves in 2 cases
Case 1 :I want to write sub main() in module and i want this as startup object for the exceution but in 2005 we are unable to keep this because it will be avilable only if aplication is Console,if i keep this when i excutes it opens Console,Login page both.So how can i start execution from SUB MAIN() of module ?
Case 2:If i keep Login form as Startup object,after validating Login i wnat to display MDI form and i want to close Login form.How can i achieve this?
Please Help me
Thanking you in advance
|
|
|
|
|
Ganesh India wrote: Case 2:If i keep Login form as Startup object,after validating Login i wnat to display MDI form and i want to close Login form.How can i achieve this?
In your static void main, show the login form and if it succeeds, show the main form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
There will be no Static Void Mian() in VB.NET its avilable in c#.net.
If we want to write sub main in Module we hage to write like
Public Sub main()
Dim x As New frmLogin
Dim y = x.ShowDialog()
If y = 1 Then
Dim frm1 As New MDIForm1
frm1.ShowDialog()
End If
'MessageBox.Show(y.ToString())
End Sub
|
|
|
|
|
Ganesh India wrote: If y = 1 Then
y = 1 ?? Is 1 the value of DialogResult.OK ? Even then, why do it this way ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
We can keep no problem ,its not the original issue after succesfully login what code i have to write to show MDI form, and what i have to do this login form ?
|
|
|
|
|
It's not the problem, it's just really bad code.
I don't get it - this code looks like it will show your MDI form, so what is the question ? Does this not work yet ? Is there no actual login form ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
See i have to keep frmLogin as SatrtUp object am i right?
if i keep Login as StartUp and after successfully login i have to show MDI form to the user.Its happening but what i have i do that Login form? because its already opened and there only we called MDI.
|
|
|
|
|
You could use
Sub Main()
Dim frmL as New frmLogin
Dim frmM as new frmMDI
Application.Run(frmL)'run login form
Application.Run(frmM)'run MDI form
End Sub
|
|
|
|
|
Please How to send info out the lpt port(Write)??
|
|
|
|
|
|
Hi,
I'd like to let my program respond if the ENTER key is pressed. I tried windows.forms.keys.enter but i just can't let it work. Error messages keep showing up or the program doesn't respond at all. I want to let the program respond with ComboBox1_KeyPress (and then the enter key)
--Zaegra--
|
|
|
|
|
Zaegra wrote: Error messages keep showing up or the program doesn't respond at all.
Sounds like you need to post the code and the errors you are getting
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Zaegra,
You need to turn on the keypreview property of the form to react to a form wide return key stroke. otherwise you have to add a kepress event on every control reacting to the return key.
Private Sub Form_KeyUp(ByVal sender As Object, ByVal e As system.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Windows.Forms.Keys.Return Then
'do whatever
End If
End Sub
nathan
|
|
|
|
|
Use the KeyDown Event (or any event that uses System.Windows.Forms.KeyEventArgs )
|
|
|
|
|
Thanks guys
--Zaegra--
|
|
|
|
|
hi,
how can i put a Progressbar in myproject to show the progress of a database operation.
i put one ,but it is not working simultaneously with the dataaccess
can anybody help me
|
|
|
|
|
Did you expect it to work by magic ? It will show progress based on how you set it. If you're calling a database, it cannot show progress, as the activity is atomic - the first you know about it is when the call has returned.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Add Reference: Microsoft ActiveX Data Object 2.8
Public Function GetEmployeesData() As Boolean
Dim iMaxEmp As Integer
Dim cn As New ADODB.Connection
Dim rstEmp As ADODB.Recordset
Dim iCounter As Integer
On Error GoTo EmpError
cn.Open "Database Connection", "username", "pwd"
Set rstEmp = Server.CreateObject("ADODB.RecordSet")
'USER FEEDBACK
frmMain.lblStatus = "Now Processing Employees Information"
frmMain.ProgBar.Value = 0
frmMain.ProgBar.Visible = True
iMaxEmp = rstEmp.MaxRecords
frmMain.ProgBar.Max = iMaxEmp
iCounter = 0
While Not rstEmp.EOF
sName = Trim(rstEmp!Name)
sAddr1 = Trim(rstEmp!Addr1)
sAddr2 = Trim(rstEmp!Addr2)
sAddr3 = Trim(rstEmp!City)
sAddr4 = Trim(rstEmp!Code)
iCounter = iCounter + 1
frmMain.ProgBar.Value = iCounter
rstEmp.MoveNext
Wend
frmMain.ProgBar.Visible = False
frmMain.ProgBar.Value = 0
frmMain.lblStatus = "Employees Information processed succesfully"
Exit Function
EmpError:
MsgBox "An Error Occured: " & Err.Description, vbCritical, "Warning"
Err.Clear
End Function
If using VB 6.0 don't forget to add the Progress Bar control on the form.
Hope this helps.
|
|
|
|
|
Unless you update each individual record yourself, you can't do what you want. The database calls don't report back any progress so there is nothing you can use to display in your ProgressBar.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi all
i want to develop a windows service in which the application will run at the back end when the system starts..
i ve vs.net 2003 and windows xp professional version 2002 service pack 2 in my system..
can it be possible....???
any help in this regard will be highly appreciated..
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
Yes, of course it's possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Of course it's possible. All you have to do is create a Windows Service project and code the thing correctly.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to send an email through vb6.0 coding.
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|