|
running vb.net 2005 & sql 2005
Ive been trying to add what seemed a simple table to a form ... only three four fields plus an update and cancel button
I managed to ( from samples ) add an OleDbConnection connecton, a OleDbDataAdapter complete with select and update commands and a dataset . From previous samples ( win 2003 dataform ) i have the four text boxex reporting back the data from the dataset ... Stage 1 complete. now here is where i was comming a cropper, when trying to update the table i used the following commands
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Try
'Attempt to update the datasource.
Me.UpdateDataSet()
MsgBox(" Update sucessful")
Catch eUpdate As System.Exception
'Add your error handling code here.
'Display error message, if any.
System.Windows.Forms.MessageBox.Show(eUpdate.Message)
End Try
End Sub
Public Sub UpdateDataSet()
'Create a new dataset to hold the changes that have been made to the main dataset.
Dim objDataSetChanges As Boss.net.DebBacsFmDestAccs = New Boss.net.DebBacsFmDestAccs
'Stop any current edits.
Me.BindingContext(DebBacsFMDestAccounts1, "DebBacsFmDestAccs").EndCurrentEdit()
'Get the changes that have been made to the main dataset.
objDataSetChanges = CType(DebBacsFMDestAccounts1.GetChanges, Boss.net.DebBacsFmDestAccs)
'Check to see if any changes have been made.
If (Not (objDataSetChanges) Is Nothing) Then
Try
'There are changes that need to be made, so attempt to update the datasource by
'calling the update method and passing the dataset and any parameters.
Me.UpdateDataSource(objDataSetChanges)
DebBacsFMDestAccounts1.Merge(objDataSetChanges)
DebBacsFMDestAccounts1.AcceptChanges()
Catch eUpdate As System.Exception
'Add your error handling code here.
Throw eUpdate
End Try
'Add your code to check the returned dataset for any errors that may have been
'pushed into the row object's error.
End If
End Sub
Public Sub UpdateDataSource(ByVal ChangedRows As Boss.net.DebBacsFmDestAccs)
Try
'The data source only needs to be updated if there are changes pending.
If (Not (ChangedRows) Is Nothing) Then
'Open the connection.
Me.OleDbConnection1.Open()
'Attempt to update the data source.
OleDbDataAdapter1.Update(ChangedRows)
End If
Catch updateException As System.Exception
'Add your error handling code here.
Throw updateException
Finally
'Close the connection whether or not the exception was thrown.
Me.OleDbConnection1.Close()
End Try
End Sub
The eupdate throws the following error
"Child list for field DebBacsFmDestAccs cannot be created"
Im at a loss as to what to do now, please can anybody help
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|
|
the problem is I'm designing a dataform which is liked with sql server 2000 table , on the table i have tree or more choices and I want the user to choose only one of them , i use for it a group of RadioButton but i can't binding it to the database
how can i Binding data to the radiobutton ,
thanks for all
jooooo
|
|
|
|
|
|
I don't think anyone can understand the Question, what is you want to bind the Radio buttons to? Do you want the radio button text to come from the Database? Or the useres selection be logged in the database?
|
|
|
|
|
Thanks my friend
i mean bind the Radio buttons to the useres selection to be logged in the database not the text of it
i wait you
jooooo
|
|
|
|
|
I don't think Binding the radio buttons to a database is even possible in that manner, and if it is I don't think its the right way to go about it.
What you would probably want to do is handle the RadioButton.CheckChaged Event and then do an insert or update statement using a SLQDataAdapter or SQLCommand.
Kevin
|
|
|
|
|
Thanks Kevin
I use the Radio button to binding to field on the table
for ex :
on the table the user will choose between three cases ,
the method of Stock evaluation : choose on
1- FIFO
2- LIFO
3- Cost Average
I want to make the three choice as Radio button and binding it to the tree fields on database
i'm waiting your reply eagly
jooooo
|
|
|
|
|
That was pretty vague but if I understand correctly there are 3 fields in a table in the database, and you want to use the radio buttons to choose which field to select from?
<br />
dim Field as string<br />
IF rdb1.checked THEN<br />
field = 'field name<br />
else if rdb2.checked THEN<br />
field = 'field name 2<br />
else<br />
field = 'field name 3<br />
end if<br />
Thas pretty bad programing style but for purpose of explination it will suffice
Now you perform the select statement
<br />
SomeAdapter.SelectCommand.CommandText = "SELECT " & Field & " FROM some table WHERE somecontraints<br />
hope that helps
|
|
|
|
|
how can i develop a vb.net pocket pc application using oracle as the database?
isha
|
|
|
|
|
Does Pocket PC support Oracle ? If so, then just use it. if not, you can't.
Christian Graus - C++ MVP
|
|
|
|
|
If your pocket PC doesn't support Oracle, you will obviously need to host the database remotely, and access it from the PocketPC.
Aside from that, I don't know what type of answer you're wanting from "How can I develop a vb.NET...application". You can check out the Sytem.Data OleDB classes.
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
how can i develop a vb.net smart device application using oracle as the database?
isha
|
|
|
|
|
Well, for starters you could start reading up on the OleDB objects in the System.Data.OleDB namespace. Here's an article that should give you a nice primer in VB.NET : http://www.startvbdotnet.com/ado/oracle.aspx
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
i have to change the system date in vb.net,
i ll enter some date in the textbox and click on a button,the systemdate shud get chaged to watever date i have entered in the textbox
kavitha
|
|
|
|
|
I do not know if this is possible in vb, but you could shell to DOS and run the Date command i.e.
cmd /c date 20-11-06
This will work assuming you have rights to change the system date
Steve Jowett
|
|
|
|
|
hi everybody
i want dropdown menu like menu in form editor in vb 6.o from where we resize our controls,can anybody help me how i can make them.
Thanks
Thanks
|
|
|
|
|
Hey all again, i'm still doing that project, i figuired out how to do all the multiple forms and modules. But now i have a different problem.. Changing the menu colour... once again i need to be able to understand and reuse this code, i need to be taught. Thankyou very much
|
|
|
|
|
Tj. wrote: Hey all again, i'm still doing that project
Don't assume we have any idea what you're talking about Especially if it is relevant to your question. I am completely clueless as to what project you're doing
Tj. wrote: But now i have a different problem.. Changing the menu colour...
Can you be more descriptive? Which menu, which color? A font color, a background color, a border color, a highlighted color...
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
i really need help or suggestion in my project proposal...
i have already a billing reports but the problem is that i don't know how to print it using visual basic.i dont know the code or the procedure to do it.
i look forward of your reply,thank you so much
|
|
|
|
|
Are you using VB.NET, or VB6 ? If you specify which one, and type the word 'print' as well, Google will tell you the answer.
Christian Graus - C++ MVP
|
|
|
|
|
Better you can use datareport or crystal reports for billing format.
|
|
|
|
|
hi!!!
thanks for that suggestion, but the problem is that i dont know the code or the procedure in printing the billing using datareport or crytal report.
any suggestions....thank you so much
|
|
|
|
|
Hi there....
I wrote a program under Visual basic to read pulses from a reed switch that i put it in my car, using parallel port.
I already put io.dll as mentioned in your site.
But when i tried it in my car the wiindow seem doesnt read it correctly.
I assume it was because it was windows dependence.
How do i make it less windows dependency?
in my program i simply write it like this:
Public Sub Timer3_Timer() * interval is 10
TerraGanti.Caption = PortIn(889)
End Sub
The program didnt catch up all the pulses correctly.
Please tell me how to fix it.
Thank u so much for helping me.
Best Regards,
Tegar Astarestu
|
|
|
|
|
vidante wrote: How do i make it less windows dependency?
I'm not sure what you mean. If you're using VB, you're dependant on Windows, no two ways about it.
Christian Graus - C++ MVP
|
|
|
|
|
I tried an commercial software for eletronic odometer, and it says that their software is less windows dependency, so it will read pulses from the reed switch on a wheel of the car correctly.
The software is run under windows. I think it was Visual C++.
What i am trying to do similar, counting pulses from a wheel, but it read the pulses as it wish, not as i wish....
You know, I've started a project, but I cant finish it.
You know how the feeling, right?
oh my....
|
|
|
|