Questions and Answers:


Ajay Asked: Is there a way to set different paging styles

Answered: Yes, the paging is completely customizable


Jason Asked: How would you use Stored Procedures with .NET 2.0


Mario Rousseau Changes Question To: I miss the first 2 presentations. Is WebMatrix exist for ASPNET 2.0. I used tto develop ASPNET 1.1


Rt7 Asked: What are the new features in 2.0 for multiple access to same data ?


kishore Asked: Does gridview have functionality of Datarepeater?


dbarselow Changes Question To: How can pictures be included with a record


mahasti safaei Asked: Is new version of ASP work with sql server 2000 as well?


david Asked: Is clientside sorting of data supported with GridView?

Answered: Not today - but keep an eye at ATLAS that will be coming out later this spring from MS


John Black Asked: Will ADO.NET Inserts be as fast, with a large table, as using the T-SQL 'OpenXML' function?


Rt7 Changes Question To: What are the new features in 2.0 for multiple access to same data ? Also the main advantage of using DAL is to prevent others to see the data access code and build multiple tiers we app in ASP.NET ?


th Asked: Where can we get the recorded version of this webcast?


Mario Rousseau Changes Question To: I miss the first 2 presentations. Is WebMatrix exist for ASPNET 2.0. I used tto develop ASPNET 1.1


hiSoWn Asked: Where would I find resources integrating XML with ado.net or asp.net?


Yu-Long Kung Asked: can I customerize the gridview cell background color based on the value inside the cell?


Jerry Asked: Is there a way to retrieve the value of a specific cell in the grid? (ie. Row 1, Column 2)


Vinay Suthar Asked: how to handle errors from database when using sqldatasource. e.g the error we saw when deleting a movie

Answered: Yeah, that's a good question. You can't handle errors locally using the default mechanism. The best option is to handle them globally in HttpApplication.Error. If you want to handle them locally, you pretty much need to write a data layer and use the ObjectDataSource


DHall Asked: can I drag SQL views on the form the same way as tables?

Answered: Yes, absolutely. Stored procs too


-JR- Asked: Is the data limited to ODBC connections?


Kannan Rajagopalan Asked: I saw that you have used static classes while displaying data using ObjectDataSource. If i use a non-static class, how would my objectdatasource automatically instantiate that class?


Sanjiv Asked: I had heard that 2005 is gonna have Image control that can directly display Image from ImageBytes, is this true ?


Sourena Asked: can e test clientside sorting using atlas beta release?


Quang Asked: Where can I download the power point for Part 1 - 2 of your webcasts?


Jerry Asked: What did you get the movies data? I'd like to keep it up-to-date, so any reference to the source data is appreciated.

Answered: I just scanned various sources on the internet (like rottentomatoes.com) - there's no free database that I coudl find


Aleks Kleyn Changes Question To: how i can use validation control. will you cover it in next lecture


Sourena Changes Question To: can we test clientside sorting using atlas beta release?


Aleks Kleyn Changes Question To: how i can use validation control. will you cover it in next lecture


CStephens Changes Question To: My development environment requires that stored procedures be used. Where would I find additional examples of how to implement data binding using stored procedures?


Sanjiv Changes Question To: I had heard that 2005 is gonna have Image control that can directly display Image from ImageBytes, is this true ? So, can i have a property of my collection hold the image bytes, and then bind it to DataGridView ?


matt harbowy Asked: when I drag a table data source onto my design view, I only see read only, not edit and update. How do I enable updating tables?


wbochar Asked: If you use a custom template in details/grid view with eval()/bind() is there a way to have an SQL DateTime column bind()/Eval() to a textbox for time and a calendar control? As a Calendar cant modify time..

Answered: Yes, absolutely. You would add a calendar control to the EditItemTemplate and then use the Bind syntax to map it onto the currently selected date


Em Asked: What is the link again for the downloads of the webcasts?


Lenny Asked: f you want to display data from two tables on the same page, do you have to define to connections? If so, wouldn't it be inefficient?

Answered: By default each query requires a separate connection, but connections are pooled by default in ADO.NET so the overhead ends up being pretty small


DevanJ Asked: Can the DataSource control use cached data instead of pulling the data from your database everytime the page is loaded? If so how?

Answered: Yes, there is an EnableCaching property on the data source control which drops the DataSet into the cache, complete with expiration timeout, etc.


john Asked: I see we're at Slide 27 of 28. What's the final slide of?


Andy Asked: Is there a method to dynamically alter the filtering of the data depending upon user logged in ot the web application?

Answered: You'd have to build that in as a parameter to your select statement, and populate the parameter in the OnSelecting event of the data source control


Pradip Das Asked: I cannot find the download link at http://www.learn2asp.net/Campaign.aspx. I want to download the C# presentations including the example codes.

Answered: You can download the samples for all these sessions from http://pluralsight.com/fritz/webcasts.aspx


Greg G. Asked: Isn't the DB connection string better defined in the web.config to properly utilize pooling?

Answered: It doesn't affect pooling, as long as it is the exact same string, the connection will be pooled, regardless of where the string is stored.


Aleks Kleyn Changes Question To: how i can use validation control. will you cover it in next lecture


Max Herrera Asked: On the detailsview slide. It seems that the select commands are in error (e.g., updatecommand="select . . . ")

Answered: Yes, that was a typo - thanks.


Adel Asked: There is a typo: It should be DeleteCommand="Delete ..." and so on page 8

Answered: Yep, thanks.


Mario Rousseau Asked: I miss the first 2 presentations. Is WebMatrix exist for ASPNET 2.0. I used tto develop ASPNET 1.1

Answered: No, but you can use VS.NET 2005 Express which a free version of the IDE.


mike Asked: what's the link for the eval - I'm getting a DNS error


DJG Asked: what happened to code-behind - all of this code appears to be in the presentation layer?!

Answered: Actually, there just wasn't any code at all. I had code behind files, but there was no need to use them in my examples because of the declarative data sources.


Greg G. Asked: Does each instance of a control and/or individual session pull a server cached copy of a dataset from the main DB when using a declarative data source?


Marlon Asked: is there error checking on databound controls?

Answered: No - see my earlier response.


Sekar Asked: Data bind control data sources use conneection pool?

Answered: Yes - see my earlier response.


CStephens Asked: My development environment requires that stored procedures be used. Where would I find additional examples of how to implement data binding using stored procedures?

Answered: It's very similar to what I showed. You can drag them onto the design surface directly using the server explorer.


Jeff O. Asked: Can you replace the "Edit", "Delete", etc LinkButtons with ImageButtons in GridView controls?

Answered: Yes, they are all completely customizable


Vinay Suthar Asked: when using sqldatasource how to handle database error. it there some page level or sqldatasource level event to do that


Fuzzhead Asked: Does the Eval() function within a databound control automatically controll for NULL values?

Answered: Yes, it will default to rendering an empty string


Jonathan Asked: Should we bother learning all this in ASP .Net 1.1?


DHall Asked: You ran out of time for heirarchical binding examples. Are there some in your labs?


dbarselow Asked: how does a picture become associated with a record in a database


Mark Asked: does all this drag and drop of items from server explorer generate code behind methods?


Al Asked: So, then would it pull back an entire table even if very large?

Answered: Yes - it will pull back whatever your query asks for. That's why in the object data source example we showed how to do it 10 rows at a time to contrast.


Lenny Asked: (chaser to the double connections methods). two queries can be done on one connection in a serialized fashion. Even though connections are pooled, there is an overhead associated when connection is reassigned. Tradiotional way of doing it would be to open connection, retrieve one set, retrieve second set, release connection. Is it possible to do the same declaritively? Or for this level of efficiency it would require doing middle tier?


Gus Gutierrez Changes Question To: How do I download a GridView into an Excel sheet?


Greg G. Changes Question To: Does each instance of a control and/or individual session pull a server cached copy of a dataset from the main DB when using a declarative data source? I promise not to ask you about your clock! Thanks!


Jody Brooks Asked: Can we download the movie's db file so we actually have some working data to match the demo code?

Answered: Yes, I have sql scripts as part of the download for the demos of this session.


jketola Asked: The "Details View" PPT slide has some typos: It uses SelectCommand for the delete and insert commands.

Answered: Yep, thanks.


John in Tulsa Asked: is there a mechanism for specifying environment (DEV, TEST, PROD) in connection strings to help with staging in deployment?

Answered: There is a new add-on feature they have provided for VS.NET that does this, yes. Look on www.asp.net for the Web Deployment addon


Druva Chadalavada Asked: how do you secure the connection strings in web.config, i mean encrypting them

Answered: You use the aspnet_regiis command-line utility with the -pe option


Andy Asked: How do you code for user name and password to log into sql server?

Answered: ua=xx;pwd=yy


klogan Asked: Any idea how to get Intellisense to work with stored procedures in Oracle?


Aman Bhardwaj Asked: When binding a GridView to a DataTable in a DataSet, the table columns of type Enum are automatically bound to a DataGridViewTextBoxColumn. How can we automatically bind such columns to DataGridViewComboBoxColumn populated with all the Enum string values?

Answered: there's no automated way to do this, you have to use a template field. See my blog entry on techniques for doing this: http://pluralsight.com/blogs/fritz/archive/2005/10/31/16059.aspx


Quang Changes Question To: Where can I download the power point for Part 1 - 2 of your webcasts?


ab Asked: what is the best book for asp.net 2

Answered: I don't have any recommendations right now since I'm inthe process of writing one.


preedy Asked: The datalist examples I have seen let you edit one record at a time, but is there a way to put all rows in edit mode, and update them all at once?

Answered: Not that I know of.


Ted Asked: does 2.0 do anything to make binding to hierchical (sp?) data that is being stored in a relational table?

Answered: If you can select the data as xml, you can bind it to the XmlDataSource - that's your best bet.


Dave Asked: How does SQLDataSource and ObjectDataSource handle NULL SmallDateTime fields within SQL? I receive CastException errors when my database fields have NULLs. Also, do you know of any tools that can creaet my type classes automatically when using ObjectDataSource?

Answered: There's an option in the objectdata source for treating nulls as something else (like MinDate). as for data layer creation, you might look into CodeSmith


nick Asked: what does List do in List<Person> syntax ?

Answered: It's a typesafe list that stores Person types in it.


Niru Baktha Asked: Does .NET 2.0 have ObjectSpaces?

Answered: No, ObjectSpaces still has not shipped.


Monique Asked: batch processing. The records are still processed 1 at a time but your code doesn't have to wait, when the user does an update they program tell .net to batch process and then on an update cmd in the program the batch is processed


Jay Asked: Is there anyway I can download the source code on the show?

Answered: http://pluralsight.com/fritz/webcasts.aspx (I'll upload as soon as I'm done with these questions)


john Changes Question To: What are ObjectSpaces?


F. Roseman Asked: The efficiency of returning just X number of rows. Is that only a feature of Microsoft SQL Server?

Answered: That particular example was a sql server 2005 feature, yes. You can do something similar with temp tables in other databases.


Ather Kazi Asked: Is this pagination technique generic across databases oracle etc

Answered: Not the SQL syntax, but you could do something similar


Ivan Asked: Using FormView with InsertItemTemplate: How can I put some default text into one of the input bound fields? For example: Current Date

Answered: See my blog entry on how to do this: http://pluralsight.com/blogs/fritz/archive/2006/01/16/18054.aspx


sw1 Asked: regarding encryption for parts of the web.config, which classes are used?

Answered: You use the command line tool aspnet_regiis


pauln Asked: How do I load the movie database into sql server express?

Answered: express should come with an admin tool that lets you run sql scripts. Make sure you install the admin console when you install the product.


Gus Gutierrez Asked: How do I download a GridView into an Excel sheet?

Answered: Hmm, no simple way that I can think of at the moment.


Kannan Rajagopalan Changes Question To: I saw that you have used static classes while displaying data using ObjectDataSource. If i use a non-static class, how would my objectdatasource automatically instantiate that class?


Rob Hyland Asked: I have a simple WebForm with one control-- a WebPartManager control. When I run the page to view it in browser-mode; I get some sort of strange error that a connection to a server cannot be established?! What is the problem?

Answered: You probably don't have the aspnet default database installed (run aspnet_regsql.exe to install it)


Luis Asked: How do I get the lab exercises

Answered: http://pluralsight.com/fritz/webcasts.aspx


pauln Asked: Where do I get the sql script for teh movie database ?


Kannan Rajagopalan Changes Question To: I saw that you have used static classes while displaying data using ObjectDataSource. If i use a non-static class, how would my objectdatasource automatically instantiate that class?


Aleks Kleyn Asked: how i can use validation control. will you cover it in next lecture

Answered: Unfortunately we're not covering them because of time constraints. There are good examples of using them up on www.asp.net.


DanP Asked: what are some good resources to learn more about coding a DAL?

Answered: I don't have any specific resources handy right now, but there's a lot of information out there on the web if you search.


Jody Brooks Asked: I couldn't find the admin console but will look again... that will give me tables but no data though...


Dave Asked: Whats the best way to publish an ASP.NET 2.0 app to a produciton server? I've tried publishing but it replaced all files.... The issue with this is the my connectionString gets overwritten (diff. from production/test).


Rt7 Asked: What are the new features in 2.0 for multiple access to same data ? Also the main advantage of using DAL is to prevent others to see the data access code and build multiple tiers we app in ASP.NET ?

Answered: There is minor support for optimistic concurrency where it will annotate your update statement to check to see if the old values changed before overwriting them - but that's it. Well, that, and giving you full control over how the data is retrieved.


kishore Asked: Does gridview have functionality of Datarepeater?

Answered: no, you can still use the Repeater control


Greg G. Changes Question To: Does each instance of a control and/or individual session pull a server cached copy of a dataset from the main DB when using a declarative data source? Thanks!


John Black Asked: Will ADO.NET Inserts be as fast, with a large table, as using the T-SQL 'OpenXML' function?

Answered: Hmm, good question - I'd try a benchmark and find out.


Yu-Long Kung Asked: can I customerize the gridview cell background color based on the value inside the cell?

Answered: Yes, it's very customizable - just play around with all the style attributes.


Jerry Asked: Is there a way to retrieve the value of a specific cell in the grid? (ie. Row 1, Column 2)

Answered: There is, but it's tricky if you're doing it from code. You basically need to traverse the object model of the gridview.


Kannan Rajagopalan Asked: I saw that you have used static classes while displaying data using ObjectDataSource. If i use a non-static class, how would my objectdatasource automatically instantiate that class?

Answered: It would create a new instance of your class for each request. That's why I tend to use static classes.


Sanjiv Asked: I had heard that 2005 is gonna have Image control that can directly display Image from ImageBytes, is this true ? So, can i have a property of my collection hold the image bytes, and then bind it to DataGridView ?

Answered: They had it, but removed it prior to release :(


Sourena Asked: can we test clientside sorting using atlas beta release?

Answered: I believe so - check out atlas.asp.net


Quang Asked: Where can I download the power point for Part 1 - 2 of your webcasts?

Answered: just pdfs at http://pluralsight.com/fritz/webcasts.aspx


Rt7 Asked: I get caught up lot of times at when a non server side control can be used instead of a server side control like a textbox for searching movies for example.


matt harbowy Asked: when I drag a table data source onto my design view, I only see read only, not edit and update. How do I enable updating tables?

Answered: Hmm, it should have editing - not sure what the issue is.


Rt7 Changes Question To: I get caught up lot of times at when a non server side control can be used instead of a server side control like a textbox for searching movies for example. Any good resources for that ?


john Asked: What are ObjectSpaces?

Answered: It's a relational-object mapping mechanism, not sure if it will ever ship so don't worry about it ;)


Rt7 Changes Question To: I get caught up lot of times at when a non server side control can be used instead of a server side control like a textbox for searching movies for example. can u please point out any good resources for that ?


Greg G. Asked: Does each instance of a control and/or individual session pull a server cached copy of a dataset from the main DB when using a declarative data source? Thanks!

Answered: It doesn't use a cached copy unless you enable caching (in which case yes)


Vinay Suthar Asked: when using sqldatasource how to handle database error. it there some page level or sqldatasource level event to do that

Answered: Not that I've been able to find - best option is to handle them globally in global.asax - OnError


DHall Asked: You ran out of time for heirarchical binding examples. Are there some in your labs?

Answered: Yes, there's a sample in the lab of using the XmllDataSource


Mark Asked: does all this drag and drop of items from server explorer generate code behind methods?

Answered: No, no code at all


Aleks Kleyn Asked: How I can debug store procedure when I debug call of my asp page in studio.net


Lenny Asked: (chaser to the double connections methods). two queries can be done on one connection in a serialized fashion. Even though connections are pooled, there is an overhead associated when connection is reassigned. Tradiotional way of doing it would be to open connection, retrieve one set, retrieve second set, release connection. Is it possible to do the same declaritively? Or for this level of efficiency it would require doing middle tier?

Answered: Not really, you would have to use a middle tier


klogan Asked: Any idea how to get Intellisense to work with stored procedures in Oracle?

Answered: nope - sorry!


pauln Asked: Where do I get the sql script for teh movie database ?

Answered: it's in the downloads for the 1st session - plus I'll put them in today's session downloads too


john Asked: I see we're at Slide 27. What's on Slide 28?


Dave Asked: Whats the best way to publish an ASP.NET 2.0 app to a produciton server? I've tried publishing but it replaced all files.... The issue with this is the my connectionString gets overwritten (diff. from production/test).

Answered: come to tmorrow's session, we'll talk about deployment


Rt7 Asked: I get caught up lot of times at when a non server side control can be used instead of a server side control like a textbox for searching movies for example. can u please point out any good resources for that ?

Answered: Sounds like you might want to look at atlas.asp.net


Aleks Kleyn Asked: How I can debug store procedure when I debug call of my asp page in studio.net

Answered: if you have the right versiono of vs.net, it should 'just work'


john Asked: I see we're at Slide 27. What's on Slide 28?

Answered: just a goodbye slide - gotta run - bye!


Lenny Asked: How does one suppose to do a binding on a control that has multiple sources... e.g. if with movie reviews db, if we had a dropdown with "great", "ok", "soso", "yuck" choices, all defined as another table in db, how can one do binding such that dropdown is filled with all those choices, but selected index matched that of current record?

(Print or Save this page, or copy the page contents to the clipboard and paste it into a file on your computer.)