
jfackler
*Experts*
-
Posts
400 -
Joined
-
Last visited
About jfackler
- Birthday 03/04/1960
Personal Information
-
Occupation
Physician
-
Visual Studio .NET Version
vb.net standard
-
.NET Preferred Language
vb.net
jfackler's Achievements
Newbie (1/14)
0
Reputation
-
The poll starts to sound like a personal ad: SWM former party starter come nerd seeking big boss with big money status with designs on fashionable white house with stately white picket fence. VB/C#s Reply only if turn ons include passionate discussions of net OOP over CRT lit dinners.
-
What you are doing is essentially data validation, correct? For all the text boxes on a form you could do this: Dim tbo As TextBox Dim ctrl As Control For Each ctrl In Me.Controls If TypeOf ctrl Is TextBox Then tbo = CType(ctrl, TextBox) AddHandler tbo.Validating, AddressOf tboerrorHandler End If Next Then: Private Sub tboerrorHandler(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Dim tb As TextBox tb = CType(sender, TextBox) If Not tb.Text = "" Then 'compare your text value to the bound dataset value here 'or consider testing for a datatable row change here End If End Sub Look here for hints on tying up row change events. Jon
-
Updating a database table with a dataset
jfackler
replied to cpopham's topic in Database / XML / Reporting
This help? Jon -
Determine which one of 50 dynamicly created textboxes has chnaged
jfackler
replied to eramgarden's topic in ASP.NET
Use a dataset and simple bind your data to the textboxes. Updates will persists any changes back to the database source. Check Wrox Press: Beginning ASP.NET Databases using VB.NET walks you through it step by step. Jon -
The font shouldn't have any impact. However, keep in mind your column width is a pixel value when you set it. Also, the function of a multicolumn list box is to place items into as many columns as are needed to make vertical scrolling unnecessary. Are you trying to have multiple columns of related data? like: index1 data1 index2 data2 Check this link
-
See what your combobox1.selectedvalue is in your Sub PopSubDropDownArray() Sub PopSubDropDownArray() 'put the debug before any other line in the sub debug.writeline("Combobox1.SelectedValue is " & ComboBox1.SelectedValue) I think your selectedvalue is out of range for you cat_id Have you considered using a dataset? Might want to take a look here. Jon
-
I think we need to see the selectedindexchanged event....or at least the code fragments that call the subs you have shown us.
-
binding data After establishing the complex binding (to the combobox) and simple binding (to the text boxes), setting the BindingContext of the form establishes which record is displayed on the form. Set it equal to the selectedindex of the combobox. example: cmbEmployeeName.DataSource = dataset1.Tables("Employees") cmbEmployeeName.DisplayMember = "Name" lblEmployeeName.DataBindings.Add("text", dataset1, "Employees.Name") lblPhone.DataBindings.Add("text", dataset1, "Employees.Phone") then, in the selectedindexchanged event of the combobox, reset the bindingcontext: Private Sub cmbEmployeeName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbEmployeeName.SelectedIndexChanged Me.BindingContex(dataset1, "Employees").Position=cmbEmployeeName.SelectedIndex End Sub Jon
-
An Answer Dr I had a similar issue: had 70 text boxes that an administrator needed to edit on occasion. To wit: employees entered clock-in and clock-out times via a time stamp formated by the code, but I wanted the admin to be able to freely enter times in a specific format in the textboxes on a summary form of the employees biweekly hours when they (as humans will) screwed up. I needed to guard against a daft administrator however, and so created the errorprovider code that follows to assure he/she put the time in in the format my code expected. I think you can tweak the code to make it work for you. The first bit adds a handler to all the textboxes on the form. The second does the heavy lifting via a regex to check the format. Imports System.Text.RegularExpressions Dim tbo As TextBox Dim ctrl As Control For Each ctrl In Me.Controls If TypeOf ctrl Is TextBox Then tbo = CType(ctrl, TextBox) AddHandler tbo.Validating, AddressOf tboerrorHandler End If Next And the second part: Private Sub tboerrorHandler(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Dim tb As TextBox tb = CType(sender, TextBox) If Not tb.Text = "" Then Dim myregex As New Regex("[0-9]{1,2}:[0-9]{2}\sAM|PM") If Not myregex.IsMatch(tb.Text) And Not tb.Text = "" And Not tb.Text = "PTO" Then ErrorProvider1.SetError(tb, "Input must be in the format HH:mm AM/PM or PTO") Else : ErrorProvider1.SetError(tb, "") End If Else : ErrorProvider1.SetError(tb, "") End If End Sub PTO in the above designates an abreviation allowable in the code as well...stands for Paid Time Off (something I wish I was fortunate enough to recieve). Hope it helps....and sorry for the grief you took up to this point. Jon
-
Assuming you want to remove the selected item: If MessageBox.Show("Are you sure you want to clear your Ban List?", "CoD Administration .Net", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = DialogResult.Yes Then ListBox6.Items.Remove(ListBox6.SelectedItem) Else Exit Sub End If Jon
-
Dim boldeddates() As Date boldeddates = New Date() {#4/21/2004#, #4/22/2004#, #4/29/2004#} MonthCalendar1.BoldedDates = boldeddates Jon
-
This will work: Time = Now.ToShortTimeString.Replace(" ", "") Jon
-
Database record problems...no clue!
jfackler
replied to dakota97's topic in Database / XML / Reporting
Try this: If MyReader.Read Then Debug.WriteLine("Returns: " & MyReader.GetString(0)) and see what you get. -
Database record problems...no clue!
jfackler
replied to dakota97's topic in Database / XML / Reporting
This Statment: While MyReader.Read lstSearch.Items.Add(MyReader("Drawing #")) MyConnection.Close() MyReader.Close() MyCommand.Dispose() End While will only read the first line in your data. Since you close the DataReader and the connection after each line read, it will of necessity, reopen and start at the beginning again. Move the close and disposes out of your loop. I'm suprised you dont get get an overload error. Are you getting a true error or is your If statement returning the messagebox informing you of no records? Jon -
The first way, you are binding to a datatable. The second, you are binding to a dataview. "A major function of the DataView is to allow data binding on both Windows Forms and Web Forms. Additionally, a DataView can be customized to present a subset of data from the DataTable. This capability allows you to have two controls bound to the same DataTable, but showing different versions of the data. For example, one control may be bound to a DataView showing all of the rows in the table, while a second may be configured to display only the rows that have been deleted from the DataTable. The DataTable also has a DefaultView property which returns the default DataView for the table. For example, if you wish to create a custom view on the table, set the RowFilter on the DataView returned by the DefaultView."