How can I shorten this lengthy code, which is not right as well? Though I want to write it using if condition / select case instead of using DateTimePicker. It starts from 7:00 AM, 7:15 AM, 7:30 AM, 7:45 AM, 8:00 AM ................So on until 7:00 PM.
Hi i have installed the visual studio 2014 and work on my project and later uninstalled it but i am getting problem with vs basic and kmp player,as soon as i open the kmp player the vs basic error report is displayed and stops working of my kmp player and showing me message box to retry the operation.
I am trying to get a gridview to work using a selectedIndexChanged event handler. I want to "select" an item from the category then using a GridView, i want to display the products and offer the user a way to select a product. Upon selection, i want to handle the event by using the SelectedIndexChange event and display the primary key/productId for the product selected. My code does not seem to be working. I'm getting a null reference exception. I'm new to visual studio, it seems easy until i try and get something to work.
here is my code so far
ProtectedSub SqlDataSource1_Selecting(sender AsObject, e As SqlDataSourceSelectingEventArgs) Handles SqlCategories.Selecting
EndSubProtectedSub GridView1_SelectedIndexChanging(sender AsObject, e As GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging
Dim intProductID AsInteger = Nothing
intProductID = GridView1.SelectedDataKey.Value
Label1.Text = intProductID.ToString
I have a screen shot of my design view but do not see a way to post it here.
I don't see where the error is supposed to occur. What I do see is some very dangerous SQL statements that leaves your database open to SQL injection attacks. You should learn to use proper parameterised queries in your SQL statements.
Also, do yourself a favour and give your controls meaningful names, rather than accepting the default names generated by the designer. You might remember what value txt4 holds now, but when you come back to the code in a few months, you'll have no idea what it means.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Last Visit: 31-Dec-99 19:00 Last Update: 30-Nov-15 15:45