
winesls
Members-
Posts
16 -
Joined
-
Last visited
winesls's Achievements
Newbie (1/14)
0
Reputation
-
Thanks Jabe The form is no longer throwing an exception. Looks like I need to do some additional coding, but at least they should track. Thanks again
-
I did find one correction to my post: Me.rbCostBehavior0.DataBindings.Add("Checked", DsCOA1, "sCostBehavior") Should read: Me.rbCostBehavior0.DataBindings.Add("Checked", DsCOA1.ChartofAccounts, "sCostBehavior") etc.
-
Hi all With much consternation, I've been trying to bind two groups of radio buttons to a dataset. The field are booleans MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call COABindingManager = Me.BindingContext(DsCOA1, "ChartofAccounts") Me.rbCostBehavior0.DataBindings.Add("Checked", DsCOA1, "sCostBehavior") Me.rbCostBehavior1.DataBindings.Add("Checked", DsCOA1, "sCostBehavior") Me.rbCostCenter0.DataBindings.Add("Checked", DsCOA1, "sCostCenter") Me.rbCostCenter1.DataBindings.Add("Checked", DsCOA1, "sCostCenter") End Sub When running the app, an exception is shown: Additional information: Cannot bind to property or column bCostCenter on DataSource. This exception will also throw on the bCostBehavior column. I'd greatly appreciate any information on binding radio buttons. Thanks in advance.
-
OK I found another sort switch down in table mappings collection. That one works.
-
I want to turn the sort property off on a data grid. So, I go to the properties table and set "Allow Sort" to false. I run the project, click on a column header and guess what - still sorts. Hmm... The designer code correctly shows allow sort as false. Is there any other place i should be looking? Thanks
-
That looks really good! I'll give it a try. I was about fifteen percent along on a VB6 project and decided to go with .Net I was hoping to forego having to wallpaper the code editor with constant connections and recordset declarations, close connections, etc. This still looks a lot cleaner than VB6 and ADO I was coming up with. Thanks for your help.
-
Thanks That's certainly a different approach from what I have seen. Please allow me to regurgitate to make sure I get it. We fill the dataset with a single record. We then create a datatable and assign the values from the dataset. Once the edit has been done on the datatable, we update the database through the data adapter. My question is this: At the end of Denae's edit procedure, he adds a new row to the data table, setting its position to the current record. Are there two rows or one at this point? If there is only one, then I assume that the rowstate has changed to modified, and the data adapter will modify the database through an update command. From his notes, it seems he prefers to rely on the command generator wizard only for loading datasets. Thanks
-
As best as I can tell, it is. I've created about as plain vanilla test as I can (.zip enclosed). I'm sure it's something simple, but I cannot figure out what it is. Thanks test.zip
-
Thanks Jabe. I thought that was taken care of when using the command builder in the data adapter. I see the SQL statement in the designer code under OleUpdateCommand1.
-
Hi all After much searching through tutorials and books, I must be missing something (or too much or not enough caffeine). As a test, I created a test form with two text boxes as bound controls. I added an OleDbConnection to an Access database; OleDbDataAdapter; DataSet1. The data adapter contains a parameterized query that has an assigned variable. Here's the code: Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() OleDbDataAdapter1.Fill(DataSet1) 'Add any initialization after the InitializeComponent() call End Sub The data flows in yippee-skippy. I then added a button on the form to update any changes made in the text box: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OleDbDataAdapter1.Update(DataSet1) End Sub Everything works fine, except no data has changed in the database. Am I missing something here? Everything I have read shows that the data adapter takes care of checking rowstates and taking the appropriate action. Thanks in advance.
-
Might just have to call it a mystery of the sea...(coming from an accountant/part-time coder no less). The breakpoint was set after the fill and the conditional statements. I went back and wrote an if statement such that If ds.table(0).column = "book" then radiobutton(0).checked = true ElseIf ds.table(0).column = "tax" then radiobutton(1).checked = true ElseIf ds.table(0).column = "both" then radiobutton(2).checked = true EndIf Works just fine now. Thanks for your help and ideas.
-
That was my original intention. I wanted to evaluate the field in the dataset, and set a checked condition for the appropriate radio button based on one of three choices. Unfortunately I'm still struggling on making the transition from VB6 (where this was not a problem). I thought about grabbing the value of the field, throwing it in a textbox, reading the value, then setting the approriate condition. I'm just surprised that a fairly straightfoward variable assignment is not being picked up in the conditional statement, even though it appears when the app is running. It seems that the bound control is not allowing (for lack of a better term) "external access" to its assigned value. Is there some additional line of code that's missing here? The variable that is being evaluated is a string in the database. Looks like I need to go back and research datasets a little more - especially on reading a specific field. You have shoved me a little closer to where I want to go, though. Thanks
-
Hi All I have a form where the textbox (txtID) text is bound to a dataset. When running the app, the appropriate data appears in the textbox. I wish to evaluate the text property to set one of three radio buttons to "checked" Here's the code: If Me.txtID.Text = "Book" Then RadioButton(0).checked = True Elseif Me.txtID.Text = "Tax" Then RadioButton(1).checked = True ElseIf Me.txtID.Text = "Both" Then RadioButton(2).checked = True EndIf When in Break Mode, the value of txtID.Text = "", even though the textbox shows the proper Text on the form. Any ideas? Thanks
-
-