Wrox Programmer Forums
|
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
 
Old December 13th, 2009, 12:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> 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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 13th, 2009, 02:42 PM
Authorized User
 
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via ICQ to nkvd3941 Send a message via AIM to nkvd3941 Send a message via MSN to nkvd3941
Default

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.
 
Old December 13th, 2009, 03:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 14th, 2009, 08:49 AM
Authorized User
 
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via ICQ to nkvd3941 Send a message via AIM to nkvd3941 Send a message via MSN to nkvd3941
Default

Many thanks

Last edited by nkvd3941; December 15th, 2009 at 03:26 AM..
 
Old January 23rd, 2010, 01:58 PM
Authorized User
 
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via ICQ to nkvd3941 Send a message via AIM to nkvd3941 Send a message via MSN to nkvd3941
Default

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
 
Old January 23rd, 2010, 02:07 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 24th, 2010, 05:09 AM
Authorized User
 
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via ICQ to nkvd3941 Send a message via AIM to nkvd3941 Send a message via MSN to nkvd3941
Default

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..
 
Old January 24th, 2010, 05:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 24th, 2010, 07:40 AM
Authorized User
 
Join Date: Oct 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via ICQ to nkvd3941 Send a message via AIM to nkvd3941 Send a message via MSN to nkvd3941
Default

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
 
Old January 24th, 2010, 11:14 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Is the solution here
a. Attach the db in SQL 2005 and create a manual connection string ?
Yes, that would certainly work...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy One Row from Gridview to Gridview lvprasad2007 ASP.NET 2.0 Professional 0 July 28th, 2009 08:29 AM
GridView pady123 ASP.NET 2.0 Professional 0 November 13th, 2008 05:48 AM
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
Gridview Thinlizzy ASP.NET 2.0 Basics 2 July 20th, 2007 08:33 AM
GridView Sheraz Khan ASP.NET 2.0 Basics 1 July 19th, 2007 10:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.