 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
 | This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

November 25th, 2009, 08:20 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
My code looks like
Code:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="5" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id"
ForeColor ="#333333" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" ShowHeader ="false" /> // don't wanna show this column to user
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
</Columns>
</asp:GridView>
code behind file contains the folowng for deleting the item
Code:
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
con.Open()
Dim row As GridViewRow = GridView1.Rows(0)
Dim productId As Integer = Convert.ToInt32(row.Cells(1).Text)
Dim filePathSmall As String = "select PictureUrlSmall from Product where Id = " & productId.ToString()
//what is alternate method to get Id instead of row.cells(1).Text
Dim cmd1 As New SqlCommand(filePathSmall, con)
other code.............
con.Close()
End Sub
Basic que. that I am trying to ask is just to hide Id column to the user.
|
|

November 25th, 2009, 09:07 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What you're looking for is e.RowIndex in combination with the DataKeys collection of the GridView....
Imar
|
|

November 25th, 2009, 09:32 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Sorry sir, this time I did not get you much but I used the e.RowIndex but it is not working.
OK just last try that I wanna put is that please kindly tell me that how we can get the ID (or any other attribute, not sticking to the ID only ) without querystring.
I will be very thankful to you.
|
|

November 25th, 2009, 10:04 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It's because I am not getting you either. Difficult to supply a useful answer on a broken question.
Anyway, like I said: you need to use e.RowIndex. It gives you the index of the row that is currently being edited. You can feed this index into the DataKeys collection to get a reference to the DataKey for the current row. This data key then has a value that gives you...... tada, the data key or in other words: the ID of the item being editied.
Did you even bother to search Google for this? http://www.google.com/search?hl=en&s...s&aq=f&oq=&aqi= gives you lots of stuff to work with.....
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

November 27th, 2009, 06:25 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
It got me really very help. In starting the application was not working fine with the stuff, but after more google about it, it is done now. Well I did search for that when you gave me hint about e.RowIndex but it didn't work at all. But yeah the search you provided me really was very helpful.
OK day before yesterday I attended a workshop regarding database. there were issues like
1.) even application is accessed by many of the users but still it does not get slow down.
2.) when an Admin is accessing application then how we restrict the users from using that particular portion of database that admn is updating.
there were so many issues like this. But on elementary level I would still like to ask that how many users can access the application(WebShop) at the same time still application does get down???
Thank you sir for your kind help.
Last edited by sophia; November 27th, 2009 at 06:27 AM..
|
|

November 28th, 2009, 07:37 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I would still like to ask that how many users can access the application(WebShop) at the same time still application does get down???
|
It all depends. It depends on your hardware (processor, memory, disk), it depends on what you define as concurrent users, it depends on what users do (mainly browse content, or insert / update a lot of data), it depends on your internet connection speed, it depends on how well you organised the database, applied indexes and so on.
So, it depends on a lot of factors. You should be able to serve content to hundreds or maybe even thousands of users concurrently, depending on what you define as concurrent. A thousand users visiting your site between 10:00 and 10:10 may mean only as much as 50 concurrent users as users need "think time" between page requests.
The only way to tell for sure is to measure using web stress tools such as those included in Visual Studio Team System.
Cheers,
Imar
|
|

November 28th, 2009, 07:56 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Quote:
|
You should be able to serve content to hundreds or maybe even thousands of users concurrently, depending on what you define as concurrent.
|
That's what I am asking about concurrency.Once I host site then how I am able to serve the contents to users, as it will be deployed to the server then what will be my role at that stage? Where in application I need to put concurrency and how it will look like and how to acquire it?
please sir make clear these concepts as I am very confused regarding this because once application is hosted on server then how I can play role in concurrency.
Thank you.
|
|

November 28th, 2009, 08:08 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You don't "put concurrency in your system". Concurrency is simpy referring to the number of simultaneous users hitting your site. When two users request a page at the same time, you have two concurrent users.
http://www.merriam-webster.com/dictionary/concurrent
Imar
|
|

November 28th, 2009, 08:31 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Quote:
|
You don't "put concurrency in your system". Concurrency is simpy referring to the number of simultaneous users hitting your site. When two users request a page at the same time, you have two concurrent users.
|
Well sir I know that we do not have to put concurrency in our own system, I meant by the application.
OK it means application itself is well formed and we do not have to be worry about the concurrency as it will depend on the network traffic and the bandwidth of Internet connection. Am I right?
And thank you for link.
|
|

November 28th, 2009, 08:37 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I meant b the application.
|
Heuh? Don't understand what you mean here.
Quote:
OK it means application itself is well formed and we do not have to be worry about the concurrency as it will depend on the network traffic and the bandwidth of Internet connection. Am I right?
|
No, you're not right. Network traffic and bandwidth are only a small part of the story. What I meant is that many different factors influence the number of users your system can server. Clearly, a crappy written application can probably serve fewer users than a well designed system. A fast computer can handle more users than an old and slow one. A system with lots of RAM will probably perform better. A database without any optimized indexes won't perform as fast as one that;s correctly tuned. You need to take all these factors into account when considering performance.
So, as I said earlier: Test! Only with testing can you tell for sure what your application can handle.
Imar
|
|
 |