
jfackler
*Experts*
-
Posts
400 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by jfackler
-
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."
-
iebidan, New Years Eve: Rookie Night You a graduate too? Jon
-
If INSERT, UPDATE, or DELETE statements have not been specified, the Update method generates an exception.
-
OKAIDO, Have you set the variable: m_stream = new MemoryStream(); to a value? Also, is the device you are creating the stream on capable of the dsBuffdesc? Jon
-
The difference in price can be over $400. The standard edition can not create mobile projects or windows services, but does have the ability to produce web applications and work with ASP.Net and ADO.Net. There is no Crystal Reports or ability to create databases from the IDE either. If you're getting started and unsure of a long term commitment to VB.Net, buy the standard version....my guess is you'll upgrade within the year. Then gift the standard version to your local starving programer when you upgrade. Jon
-
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress e.Handled = True 'add the code to process the keypress event here End Sub Jon
-
Need help with updating multiple machines with DB data
jfackler
replied to MedicRanger's topic in Database / XML / Reporting
You could write a file sentinal windows service and install it on each machine set to monitor the .mdb file of the server. Enabling the enableraisingevents of the eventlog would allow the service to notify your clients when the .mdb changes (be careful what you instruct your sentinal to monitor, the log can become enourmous if you log everything about the file). The System.IO.FileStstemWatcher class is the place to start your exploration of these methods. After you establish what to watch and what to watch for, you can wire in event handlers for the various events that interest you. The FileSystemWatcher class events that you can trap are Changed, Created, Deleted, Error and Renamed. Obviously you would be interested in the Changed event. To handle an event, of course, you would need to write an event handler. Jon -
I'm in search of a resource for writing a tapi application in VB.NET. So far I've been unable to find anything close. I've read every page available on the net and read multiple text resources at my local computer book store. The msdn has code written in vb5 with lots of interface calls. The code falls apart under .net because of the late binding. example: Dim objCall As ITBasicCallControl objCall = objAddress.CreateCall(PhoneNumber, nAddressType, lMediaType) '********************************************************************************** '*********************************************************************** 'following is part of Select a Terminal '********************************************************************* ''query for ITBasicCallControl, the call control interface Dim objDialedCallInfo As ITCallInfo objDialedCallInfo = objCall ''query ITTerminalSupport from Address object Dim objTerminalSupport As ITTerminalSupport objTerminalSupport = objAddress Frankly, I have no idea how to go about rewriting the code for .NET without late binding. Any hints or some tutorials would be greatly appreciated. I think, after all I've read, if I can get a glimpse, the light will come pouring through and I'll be able to convert the remainder. Thanks, Jon
-
Datagrid And DataTable and BindingContext(_dt).Position()
jfackler
replied to booyeah's topic in Windows Forms
Since you know the key sort column of the original data table, you can use the defaultview of the original dataset.table and perform a find for the key value in the datarow you isolate in your popup datagrid. The result is the index of the datarow you have selected. Just reset your currencymanager.position for that datasource to the index found. Jon -
Is there a way to capture a print document and parse it's data? My office staff makes reminder calls to patients for appointments. I'd like to interrupt the report that is generated and usually printed as a patient list for phone calls. The data is held off site and not available to me in it's raw form, but I can generate the report on a network computer and send it to a network printer....thus, if I can capture the stream and parse the data, I can manipulate the data. I realize it's convoluted but is it possible? Jon
-
X, Take a look here , doing some modification of the example using the windows media player msdxm.ocx com lets you play any sound file you would like in an event. Jon