
MarkItZero
Avatar/Signature-
Posts
43 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by MarkItZero
-
Can you recomend a 3rd party Grid control?
MarkItZero replied to MarkItZero's topic in Windows Forms
I am surprised that none of the grids offer the ability to copy and paste records. That would seem like a very common request. I am guessing that to code it myself I would somehow have to capture the current row of the grid into a datarow. Given my poor coding skills, this should be quite an adventure. -
Hello, I have been having quite a bit of trouble with Microsoft's datagrid. I am now thinking that it would be more economical to purchase a 3rd party grid. I have been looking around and have found several grids but so far have not found one that incorporates all of the features that I need. Perhaps this would be a good place to discuss the benefits and downsides of the numerous grids available. The features that I need for my project include... 1. Combobox column type that allows me to display a description from a 2nd table based upon the foriegn key value from the main table (valuemember, displaymember) 2. The ability to right-click and copy and paste rows similar to excel and access. 3. The ability to somewhat easily validate the data as it is entered onto the grid. I am hoping to get away with spending $500 or less. Thanks in advance for any suggestions!
-
Hello, I will admit that I am a lousy VB.Net programmer, but when the boss says get it done, it seems I dont have much choice. I am creating a windows program using data from an Access database. I thought my best bet would be to use datagrids on my form for inserting, editing and deleting data from the tables. When I used the datagrid wizard to create my form I expected I would find a lot of the same functionality that I would find if I just opened the table in Access. Sadly this is not the case. I especially wanted to be able to copy and paste rows just like I would in Access or Excel. But I have no idea where to start. I also need to find a way to add combo boxes to my datagrid. Lastly, I have added a checkbox column to the datagrid, but it is behaving strangely. Sometimes when I click the box, nothing happens. Other times I will click the box and a dim grey check mark will appear instead of the usual bold black mark. This is the code that I used to set my datagrid properties everything else on the form was generated by the wizard... 'Set Datagrid Properties 'New Table Style Dim TSeditEquip As New DataGridTableStyle 'Table Style Properties With TSeditEquip .MappingName = "Equipment" End With 'Declare Each Column of DG Dim col1 As New DataGridTextBoxColumn Dim col2 As New DataGridTextBoxColumn Dim col3 As New DataGridTextBoxColumn Dim col4 As New DataGridBoolColumn 'Column Properties With col1 .HeaderText = "Equip Code" .MappingName = "EquipCode" .Width = 100 .TextBox.MaxLength = 15 .NullText = String.Empty End With With col2 .HeaderText = "Type" .MappingName = "EquipType" .Width = 150 End With With col3 .HeaderText = "Description" .MappingName = "Description" .Width = 250 .TextBox.MaxLength = 25 .NullText = String.Empty End With With col4 .HeaderText = "Inactive" .MappingName = "Inactive" .Width = 60 End With 'Add Columns to DataStyle TSeditEquip.GridColumnStyles.AddRange(New DataGridColumnStyle() {col1, col2, col3, col4}) 'Add DataStyle to DG grdEquipment.TableStyles.Add(TSeditEquip) Any suggestions for any of my problems would be greatly appreciated. Thanks!
-
Can I retrieve the code that makes up a .exe file?
MarkItZero replied to MarkItZero's topic in General
Ok, that wasnt what I wanted to hear. So I will just forget you even said it! :p -
Hello, I think I made a big mistake. I have a .net program which I distributed out to several users on my network. I just gave them the .exe file to run. I kept the solution files on my machine and continued to edit them. Unfortunately I didnt keep a copy of the solution files to the program that they have. I have made about a week's worth of changes to the program and now I realize that I want to go back to the older version. Does anyone have any idea how I can do this without having to spend hours pouring through code attempting to undo all of my changes? Thanks in advance.
-
Dealing with Inactive Records in a Combo Box
MarkItZero replied to MarkItZero's topic in Windows Forms
Thank you very much! I will test it out. -
I am kind of stumped right now and I am hoping for some ideas. Here is the situation. I created a windows program to manage the dispatching of our delivery drivers. The program uses an Access database to hold the data. Each day the users will enter several new dispatch entries on the DispatchDetails form. They are also able to view existing entries on this same form. Included on the form are combo boxes containing information such as DriverName, Truck, Trailer# and LoadSize. Here is the code is use to populate the CmboDriver 'Clear Dataset DsDetDrivers1.Clear() 'Fill Dataset OleDbDataAdapter8.Fill(DsDetDrivers1, "Drivers") 'Datarow Dim DRDriver As DataRow 'Declare Array Dim ArryDriver As ArrayList = New ArrayList() 'Fill Array For Each DRDriver In DsDetDrivers1.Tables("Drivers").Rows If DRDriver("Inactive") <> True Then ArryDriver.Add(New LookupItem(DRDriver("DriverID"), DRDriver("DriverName").ToString())) End If Next 'Bind and Show Cmbo Box CmboDriver.DataSource = ArryDriver CmboDriver.DisplayMember = "Text" CmboDriver.ValueMember = "ID" CmboDriver.DropDownStyle = ComboBoxStyle.DropDownList CmboDriver.Show() CmboDriver.SelectedValue = DRDispatchDetails("DriverID") The code for the other combo boxes are essentially identical. As you can see, I check the Inactive field in the driver table to make sure I only display active drivers in the combo box. That way a user will be unable to select an inactive driver for a new entry. However, because users can open, view and edit existing entries, I need to be able to display the drivers name even if the driver has since been inatcivated. So, I guess what I need is to find a way to check to see if my driver is inactive, and if he is, then I need to populate the combobox with all of the active drivers + the current driver. Sorry for the long post. I hope that makes sense. And ideas will be greatly appreciated. Thanks!
-
Hello, I have a main form which contains a listview, datetimepicker and a "Change Date" button. When the form is displayed, the listview is populated with datarows from the database based upon the selected date from the datetimepicker. When the user clicks the "Change Date" button a small popup form is displayed which allows the user to select a new date and update the database with this value. When the user clicks "Save" on the popup form, the date is saved and the popup closes. I would like to add a command to the "Save" procedure on the popup form which will cause the listview on the main form to refresh with the new values in the database. I am not exactly sure how to go about this. Hopefully that makes sense. Thank you!
-
Here is the system generated code for the Update Query... ' 'OleDbUpdateCommand1 ' Me.OleDbUpdateCommand1.CommandText = "UPDATE Tickets SET Name = ?, [Time] = ? WHERE (ID = ?) AND (Name = ? OR ? IS NULL" & _ " AND Name IS NULL) AND ([Time] = ? OR ? IS NULL AND [Time] IS NULL)" Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1 Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Name", System.Data.OleDb.OleDbType.VarWChar, 50, "Name")) Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Time", System.Data.OleDb.OleDbType.DBDate, 0, "Time")) Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(10, Byte), CType(0, Byte), "ID", System.Data.DataRowVersion.Original, Nothing)) Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Name", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Name", System.Data.DataRowVersion.Original, Nothing)) Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Name1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Name", System.Data.DataRowVersion.Original, Nothing)) Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Time", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Time", System.Data.DataRowVersion.Original, Nothing)) Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Time1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Time", System.Data.DataRowVersion.Original, Nothing)) Here is my update data procedure... 'Update Data Sub UpdateData() 'Clear DataSets DsTickets1.Clear() 'Fill DataSet OleDbDataAdapter1.Fill(DsTickets1, "Tickets") 'DataRow Dim DRTicket As DataRow = DsTickets1.Tables("Tickets").Rows.Find(ID) 'Set New Values DRTicket("Name") = txtName.Text 'Update DataSet OleDbDataAdapter1.Update(DsTickets1, "Tickets") End Sub I would use a text field instead of a time field, but later on in the program I want to be able to the calculate time differences between tickets. I suppose I could force the user to enter the time in a specified format which would allow me to convert it to an integer for the calculations. I may have to do that if I cant figure this problem out.
-
To explain further... I have an Access table "Tickets" with to 3 fields (ID, Name, Time). Tickets ID - Autonumber Name - Text Time - Date/Time Sample Data 20 - Johnson - 1/1/04 11:00am 21 - Brown - 1/1/04 3:00pm The date portion of the Time field is insignificant to me, however, since there is no time-only data type, having the date in the field wont hurt anything. On my form, I display the Name in a text box based upon an ID passed from another form. I have a Save button that allows the user to save any changes they make to the name field. I am not attempting to read, display, update or do anything with the Time field on this form. If the Time value of the record I am updating is set to 12:00am (no matter what the date), then the code works fine. But, if the Time value is anything else (12:01am, 11:00pm..) there will be an error whenever the user clicks the Save button. exception of type 'System.Data.DBConcurrencyException' occurred in system.data.dll Additional information: Concurrency violation: the UpdateCommand affected 0 records. I am totally baffled. Any suggestions? Thanks.
-
Hello, I have an Access database with a Date/Time field that I use to store time values (8:00am, 9:00pm etc). I have no problem displaying the value on my form, however when I attempt to update any of the fields from the the table, I receive an error.... An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in system.data.dll Additional information: Concurrency violation: the UpdateCommand affected 0 records. I am almost positive that the error is being caused by this date/time field. If I remove the field from the table and refresh my datasets in the program, I can display and update without any problems. If I keep the date/time field in the table and populate it with a full date like 03/11/04, I can also display and update without any problems. However, as soon as I enter a time into the field, it begins to give me that error when I try to update the dataset (even though I am not even trying to update that field). Here is the code I use for displaying and updating.. 'Display Data Sub DisplayData () 'Clear DataSets DstsTicket1.Clear() 'Fill DataSet OleDbDataAdapter1.Fill(DstsTicket1, "Ticket") 'DataRow Dim DRTSTicket As DataRow = DstsTicket1.Tables("Ticket").Rows.Find(ID) 'Fill textbox txtName.Text = DRTSTicket("Name") End Sub 'Update Data Sub UpdateData () 'Clear DataSets DstsTicket1.Clear() 'Fill DataSet OleDbDataAdapter1.Fill(DstsTicket1, "Ticket") 'DataRow Dim DRTSTicket As DataRow = DstsTicket1.Tables("Ticket").Rows.Find(ID) 'Set New Values DRTSTicket("Name") = txtName.Text 'Update DataSet OleDbDataAdapter1.Update(DstsTicket1, "Ticket") End Sub What could I be doing wrong? And why does this problem only occur when I place time values (8:00am) in the table? Sorry this was such a long question! Please Help! Thanks!
-
Hello, I have VB.net Standard edition. I would like to sure Crystal for my reporting needs; however, it seems that you need VB.net Proffesional to get the CR functionality. Perhaps someone here would know... Is it possible to use Crystal Reports with VB.net Standard if I have a full working version of Crystal Reports 8.5? And if so, how would I go about inserting the crystal viewer into my program? Thanks!
-
Do you think that the Academic version would work?
-
Damn. I wish there was a way to work around that. I already have a whole bunch of nicely designed Cyrstal Reports and it is a shame not to be able to use them with my program.
-
Is it possible to use CR with the standard version of VB.net? I was under the impression that you needed Professional to get CR functionality.
-
Is that possible with the standard version of VB.net? And if so, how?
-
OK. I figured out my second problem by changing the code 'Clear LV LV1.Items.Clear() to... 'Clear LV LV1.Clear() Still havent figured out the alignment though. I am also having a problem getting the "Date" column to display the date without a timestamp. Thanks!
-
Hello, I have a listview which I populate with 3 columns of data from an Access database. I have gotten the info to show up, however I am having a few problems with the display. My first problem is that the data values are all centered in the column instead of left justified. I attempted to correct this by using the statement.. LV1.Alignment = ListViewAlignment.Left. But this is not working. My second problem is that the column headers are repeated 9 times. I have 3 data columns (ID,Name,Date). When I open the form, the data is displayed in the proper columns under the correct column headers. The column header labels are then repeated several more times without any data below. (Hopefully that makes sense) Here is the code is use to create the listview: 'Begin Update LV1.BeginUpdate() 'Clear LV LV1.Items.Clear() 'Clear Datasets DS1.Clear() 'Fill DS1 Dataset OleDbDataAdapter2.Fill(DS1, "Delivery") 'Declare Lookup Item Dim LookItm1 As LookupItem 'Fill LookupItem LookItm1 = DirectCast(CmboBox1.SelectedItem, LookupItem) 'Declare Data Row Dim DR1 As DataRow 'Fill LV For Each DR1 In DS1.Tables("Delivery").Rows If DR1("Shop") = LI1.ID Then If DR1("DelivDate") = DatePicker.Value.Date.ToString() Then 'Declare ListItem Dim listItem As New ListViewItem(DR1("ID").ToString()) 'Add Columns listItem.SubItems.Add(DR1("Name")) listItem.SubItems.Add(DR1("Date").ToString()) 'Add Row LV1.Items.Add(listItem) End If End If Next 'Set Display LV1.View = View.Details LV1.MultiSelect = False LV1.Alignment = ListViewAlignment.Left LV1.FullRowSelect = True LV1.HeaderStyle = ColumnHeaderStyle.Nonclickable 'Add Column Headers LV1.Columns.Add("ID", 40, HorizontalAlignment.Left) LV1.Columns.Add("Name", 100, HorizontalAlignment.Center) LV1.Columns.Add("Date", 100, HorizontalAlignment.Right) 'End Update LV1.EndUpdate() Any suggestions would be helpful. This is the first time I have worked with a listview control, so if you see anything important I may have missed, feel free to let me know. Thanks!
-
Hello, I have a listbox that I fill with data from an Access database. I would like to display the items in the box in different colors depending on a value from the database. Here is the code I have so far.... 'Populate LstJobs Sub PopulateLstJobs() 'Clear lst Equipment lstJobs.DataSource = Nothing lstJobs.Items.Clear() 'Clear Datasets DsDeliv1.Clear() 'Fill DSUsers1 Dataset OleDbDataAdapter2.Fill(DsDeliv1, "Delivery") 'Declare Array Dim ArryDeliv As ArrayList = New ArrayList() Dim DRDeliv As DataRow 'Fill Array For Each DRDeliv In DsDeliv1.Tables("Delivery").Rows If DRDeliv("DelivDate") = DatePicker.Value.Date.ToString() Then ArryDeliv.Add(New LookupItem(DRDeliv("DelivID"), DRDeliv("JobName"))) End If Next 'Fill List If ArryDeliv.Count > 0 Then lstJobs.DataSource = ArryDeliv lstJobs.DisplayMember = "Text" lstJobs.ValueMember = "ID" End If End Sub I need to insert somewhere in this code something like this... If DRDeliv("DispatchID") <> 0 Then Listbox.item.color = Red Else Listbox.item.color = Black End If Any suggestions?
-
Hello, I have created a VB.net application that manipulates an Access database. I also created a Crystal Report which accepts a parameter and then displays info from the database. Because I have VB.Net Standard, it seems that I do not have the option of simply adding a Crystal Report Viewer to my project. Is there any way around this? A download that I could use to add Crystal functionality to VB.Net standard, or any other workable idea? I already have Crystal 8.5 installed on my machine, so is it possible for me to add a button to my form which will open the application and pass the parameters to it? I'm kinda lost here, so any help is appreciated. Thanks
-
Well, I took your advice, moved into the 21st century with those fancy new-fangled ADO.Net methods...and it now works perfectly! Thank you both for your help and advice. Strangely, I went back to find out where I copied the ADODB code from, and it was from a Microsoft Press book called Programing Visual Basic .Net for Access. For some reason the author teaches the ADODB way of accessing data for the first 8 chapters of the book and then not until the end does he 'lightly' touch upon the ADO.Net method. It would have saved me a bunch of time if I had done it the right way first, now I have quite a bit of code to go back and update!
-
I have been testing the code with multiple users, so the 'ArryEditUsers.Count >' 0 shouldnt cause any problems (though it is something I will have to watch out for later) My code is very piecemeal. Before starting this project I did not have any experience with VB, so I have been learning on the go and patching code in from wherever I can find it. So someone either on this site or in one of my books, I dont remember which, suggested I use ADODB. And it worked, so I kept it. Maybe next project I will take the time to learn the new fancy methods:p
-
Anyone have any ideas? I am still stuck on this same problem.
-
That doesnt seem to work either. I actually have to leave the form and come back before the changes will be shown. Though the record is actually deleted from the DB right away. Strange and aggravating
-
Ok, This problem has been a real pain for me I have a list box on a form which lists the UserNames in my DB(Access). I have a delete method which deletes the currently selected UserName from the DB. However, I cant seem to be able to get the listbox to properly refresh (ie not show the newly deleted UserName) For some reason, after I complete the delete method, the UserName still shows up in the listbox. Here is my code: 'Populate LstUsers Sub PopulateLstUsers() 'Fill Dataset OleDbDataAdapter1.Fill(DsEditUsers1, "Users") 'Declare Array Dim ArryEditUsers As ArrayList = New ArrayList() Dim RowEditUsers As DataRow 'Fill Array For Each RowEditUsers In DsEditUsers1.Tables("Users").Rows ArryEditUsers.Add(New LookupItem(RowEditUsers("UserID"), RowEditUsers("UserName").ToString())) Next 'Fill List If ArryEditUsers.Count > 0 Then lstUsers.DataSource = ArryEditUsers lstUsers.DisplayMember = "Text" lstUsers.ValueMember = "ID" End If 'Declare LookupItem Dim li As LookupItem 'Fill LookupItem li = DirectCast(lstUsers.SelectedItem, LookupItem) 'Display List DisplayUserInfo(li.ID) End Sub 'Display User Info Sub DisplayUserInfo(ByVal ID as Integer) 'Display other columns from record in textboxes End Sub 'Click Delete Private Sub CmdDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdDelete.Click 'Are You Sure If MsgBox("Are You Sure", MsgBoxStyle.OKCancel, "Service Estimate: Warning") = MsgBoxResult.OK Then 'Declare ADODB Objects Dim cnnDelete As New ADODB.Connection() 'Open ADODB Connection cnnDelete.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Estimate\EstimatesDB.mdb;", _ "Admin", "") 'Declare RecordSet Dim rstDelete As New ADODB.Recordset() 'Query Dim StrDelete As String = "Select * from Users Where UserID = " & txtUserID.Text & "" 'Fill RecordSet With rstDelete .ActiveConnection = cnnDelete .Open(StrDelete, , _ ADODB.CursorTypeEnum.adOpenKeyset, _ ADODB.LockTypeEnum.adLockOptimistic) End With 'Update RecordSet rstDelete.Delete() 'Close Connection cnnDelete.Close() 'MsgBox MsgBox("The User Has Been Deleted", , "Service Estimate") 'Refresh LstUsers PopulateLstUsers() Else 'MsgBox Not Deleted MsgBox("User '" & txtEditUserName.Text & "', Not Deleted", , "Service Estimate") End If End Sub I hope that code is readable. Any suggestions? Thanks! [edit]it's more readable with tags[/edit]