 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
|
|
|
|
|

December 13th, 2009, 12:57 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> Also is it possible to change cell fonts / colors here?
Yes, you can. That's what the exercise on page 491 is all about....
Cheers
Imar
|
|

December 13th, 2009, 02:42 PM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
How about changing the font of an individual cell, not the whole row?
What i am really struggling with is the syntax for changing the value of am individual cell.
|
|

December 13th, 2009, 03:02 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
e.Row is a GridViewRow ( http://msdn.microsoft.com/en-us/libr...idviewrow.aspx) which has, among many other properties, a Cells collection that represents the cells in the Row. Each cell then enables you to set its appearance (directly, or through the preferred CssClass property):
Code:
VB:
e.Row.Cells(0).BackColor = Color.Black
e.Row.Cells(0).CssClass = "Someclass"
C#
e.Row.Cells[0].BackColor = Color.Black;
e.Row.Cells[0].CssClass = "Someclass";
How you determine which celly you need is up to you: you can index them by number, or loop through them until you find the right one.
Hope this helps,
Imar
|
|

December 14th, 2009, 08:49 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Many thanks
Last edited by nkvd3941; December 15th, 2009 at 03:26 AM..
|
|

January 23rd, 2010, 01:58 PM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Hello once again
The above changes worked a treat - many thanks for that. I can now add colours / fonts to my gridview - it actuallly looks quite good!
Now i am on the very last leg - i am trying to get the site to fire up in IIS. I have a login db as part of the site, and a seperate main db (Recipes).
However i keep getting the same error:
"Cannot open database "Recipes" requested by the login. The login failed.
Login failed for user 'DUNCANTOMS\ASPNET'."
I followed the security setting suggested in the book to the letter.
I did however change the name of my pc, therefore the name of the sql server changed (work from home, and both my work pc and home pc had the same name).
Any suggestions? Thanks in advance
|
|

January 23rd, 2010, 02:07 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It look like you're using Windows XP, right?
Did you add the ASPNET user to SQL Server and grant it permisions to your database?
Imar
|
|

January 24th, 2010, 05:09 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Yes i am using XP.
I set permissions for user ASPNET at the folder level of my own db in the same way as i did for the sites user db folder.
Should i be be doing it within sql server itself as well? I created a DUNCANTOMS/ASPNET user withing Security/Logins of SQLSERVER. THere was previously a DTOMS/ASPNET (i.e. old to new computer name)
Thanks
Last edited by nkvd3941; January 24th, 2010 at 05:16 AM..
|
|

January 24th, 2010, 05:17 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
This is probably about SQL Server settings, and not about disk settings. Take a look at Appendix B and this article: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395
If that doesn't help, please provide more information about your system (OS, version of SQL Server, deployment method, where you encounter this error, connection strings and so on).
Cheers,
Imar
|
|

January 24th, 2010, 07:40 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Again - worked a treat - just needed to set the stored procedure permissions to Execute so that they could be executed by user ASPNET.
The web site reads my stored procs on entry, and fell over with permission errors - which are now cured.
Trouble is i am getting the "An attempt to attach an auto-named database for file *blah blah* aspnetdb.mdf failed" error, which seems a very common error.
Is the solution here
a. Attach the db in SQL 2005 and create a manual connection string ?
There seems a million and 10 solutions on the internet , not sure which one to go for
I feel very close now!
Thanks
|
|

January 24th, 2010, 11:14 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
Is the solution here
a. Attach the db in SQL 2005 and create a manual connection string ?
|
Yes, that would certainly work...
Imar
|
|
 |