Note: This code actually codes from a tutorial book I'm reading at the moment, so you can imagine this is frustrating me greatly! I'm building a basic shopping cart, using VB.NET 4, Visual Studio 2010 and MS SQL Server R2 2008. The code below is supposed to remove items from the cart, by reading a session variable, editing it to remove the appropriate ProductID and return the amending string to the session variable. It is then supposed to rebind the data to the gridview (gvCart) to refresh the data...but it seems here there is an error.
Every time I build the site in Visual Studio, it validates fine. But every time I run the site, and attempt to use the remove button it gives me the error:Incorrect syntax near ')'.ith the IDE pointing me toward the final parenthesis
Protected Sub gvCart_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvCart.SelectedIndexChanged 'This method is hooked to the Remove button & is removing items from the cart
i am developing an online shopping site..so when the user adds any item to the cart i store it in a table...now what i want is to count the number of items in the cart as well as update the number of items in cart every time the user adds a new item....
Public Function AddToCart(ByVal itemID As String, ByVal itemName As String, ByVal itemPrice As Integer, _ ByVal offer As String, ByVal buyNo As String, ByVal userID As String) As String Dim sqlStatement As String = "INSERT INTO shoppingCart" & _
How can I get the items in my code from my listbox which is called "selectListBox" to a shopping cart called "cartlistbox", when the add button is clicked?
Public Class MainForm Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
I have a List object and I want to remove the duplicated items but leaving at least one of the duplicated items in the list;I wrote something like this however I would optimize this code for better performance, is there something faster?
Const chars As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" Dim rnd As New Random() Dim mylist As List(Of String) = Enumerable.Range(1, 100).Select(Function(i)
i am making a card game and you get three cards in your hand at a time, i am using a list and random assigning to set the cards in my hand as different numbers but they keep being all the same numbers, here is what i have, what should i add to make it be a different number for every one
Dim hand1 As Integer Dim hand2 As Integer Dim hand3 As Integer
I have 2 listboxes. I want 1 Button to remove a item in the listbox, but when I use [code]It only removed ListBox2's item. How do I get it to remove both listboxs item?
I have a serious problem, I have 3 listboxes, and all three of them will get items that contain no text. My problem is that I have the same code for all three listboxes to remove "" from the listboxes except one listbox will not remove the items. I've tried countless times to remove the empty items and failed. So how do you see if a listbox's item contains no text?
I have a menu control (Menu1) and I want to add/remove items from the menu based on certain information I have stored about the authenticated user in the database. I'm not sure though how to access specific menu items from the menu control and remove them at runtime?
simple problem that i just cant figure out. here is the code
[Code]...
this code works fine as long as i dont remove ALL items, the error i am getting is index is out of bounds of the array, i have tried -1, -2 0 +1 +2 and all are still giving this error, i cant just create code for remove all as i wont always need all removed so i kinda of have to get this code or something similar to remove only checked items. the code below is code i have tried
I'm trying to remove all the checked items in my CheckedListBox. I started by doing CheckedListBox1.Items.Remove(CheckedListbox1.CheckedItems) That seemed like it would work, but it didn't. I soon discovered that CheckedListBox1.Items.Remove only works on the the strings of the individual items.
I am using a asp.net listbox. I have two buttons one to add items to listbox and another to remove. I am using javascript function to remove items from the listbox. When I add to the listbox after removing. The removed items are also getting added.
I have a string defined:Dim sir() as String ={"Et1","t1-t2","t2-t3","Et2","Et3","Et4"...."Et15"}I want to make a new array of string that eliminates the items on index 0(Et1) ,3(et2) and 4(Et3)[code]The problem is that it wont replace with blank more than 4elements and I want to replace with blank Et1 until Et15.Until et4 I have no errors. When I introduce Et5 I have this error:[code]
when I load items in to a treeview, there's several items the same.Say it's like this:[code]How do I delete the duplicate items so it only shows subitem once?