473,789 Members | 2,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView ASP.net VB Noob

I am having trouble updating a SQL table through the GridView "Auto"
Enable Edit Feature...
I am connecting to a SQL 2000 Server with a SQLDataSource
I have created the Update Query in the Command and Parameter Editor
setup when I created my SQLadapter, along with Select and Delete.

Here is the Update Command:

UPDATE TBLUPSData SET UPSModel = @original_UPSMo del, UPSLocation =
@original_UPSLo cation, UPSDeviceAttach ed = @original_UPSDe viceAttached
WHERE UPSID = @original_UPSID

I also have each 4 parameters associated to the
GridView1.selec tedvalue control

When I click on the Query Builder in the Command and Parameter
Editor, I can execute the query and actually update the tables, When
I try editing the GridView1 table in run mode, all the values that I
change after clicking the edit link and pressing the update link (on
the GridView table), nothing changes in my table?

I have also done the exact same for the delete command and it doesn't
work in GridView while in run mode but will in the query builder.
What am I missing here?

I am a noob to Visual Studios 2003/2005 data binding, are there any
good tutorials that move past the Select statement and actually help
with updating or inserting data based on user input? Cause I cant seem
to find anything good.

Thanks

Feb 8 '07 #1
1 1974
On Feb 8, 12:06 pm, "Japsk...@gmail .com" <Japsk...@gmail .comwrote:
I am having trouble updating a SQL table through the GridView "Auto"
Enable Edit Feature...
I am connecting to a SQL 2000 Server with a SQLDataSource
I have created the Update Query in the Command and Parameter Editor
setup when I created my SQLadapter, along with Select and Delete.

Here is the Update Command:

UPDATE TBLUPSData SET UPSModel = @original_UPSMo del, UPSLocation =
@original_UPSLo cation, UPSDeviceAttach ed = @original_UPSDe viceAttached
WHERE UPSID = @original_UPSID

I also have each 4 parameters associated to the
GridView1.selec tedvalue control

When I click on the Query Builder in the Command and Parameter
Editor, I can execute the query and actually update the tables, When
I try editing the GridView1 table in run mode, all the values that I
change after clicking the edit link and pressing the update link (on
the GridView table), nothing changes in my table?

I have also done the exact same for the delete command and it doesn't
work in GridView while in run mode but will in the query builder.
What am I missing here?

I am a noob to Visual Studios 2003/2005 data binding, are there any
good tutorials that move past the Select statement and actually help
with updating or inserting data based on user input? Cause I cant seem
to find anything good.

Thanks

I used this tutorial from MSDN and the pictures seems wrong or I dont
understand...

http://msdn.microsoft.com/coding4fun...ated%20content

in the pictures the editors controls are that of the columns and the
parameters include the @original_*Var Name*
he says that the SQLDataSource control has another property titled
OldValuesParame terFormatString that specifies how an input parameter
out to appear in a query. the default property is original_{0}...
so I changed my Update query to the column names and it works instead
of useing the default property value this dude speaks of.
confused on why it wouldnt work based on this tutorial but it works
now so i am almost satisfied...

-J

Feb 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5677
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the GridView to allow entry of quantity and Y/N switch for
6
3041
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the current_row_key of Grid1... to the objectDataSource2 parameter? (so that the second grid, gets only the information to do with current row of grid1)
3
13754
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state that you should always confirm a delete action. There is also a consensus that the best way to do this is a template...
7
14821
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
5
4839
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens automatically if the data doesn't change. But if records have been added or deleted then it looks as if some code is necessary: I've done this by using GridView.SelectedValue to get the key value of the currently selected Row and then by itterating...
2
13201
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few fields to be included in the table, which is to be bound to the gridview. The web form looks like so (Don't worry about the stupidity of this web form for now.):
3
1606
by: gianfranco dalfiume | last post by:
Hi all, i'm new to this newsgroup. This is my problem: i have a form with a GridView. The first column of the grid is a ButtoFields (image type) column, with some code to manage the request for the click (it computes a long, time consuming query). I need to put something to tell the user that "something is going on" after he click the ButtonField. A solution could be changing the browser cursor to hourglass, OR change the clicked image to...
6
5761
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the OnSelectedIndexChanged event set on it. This triggers just fine, but within the codebehind of the OnSelectedIndexChanged event, I need to scan through all the entries in the nested GridView (to see if the user changed a value to an already existing value in the...
3
5245
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use DataTable, I am using List of Objects. Here's one example: http://ryanolshan.com/technology/gridview-without-datasourcecontrol-datasource/
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.