Hi Alex,
I don't master CF but I think you are correct that ASP.NET requires more
code and more 'mental model'.
I also read posts that say ASP.NET with its controls (that tend to go toward
things you are doing in CF) are too simple and inflexible.
These guys want to do everything on a lower level.
Then there are people who want to do everyting as declative as possible (CF
programmers fall into this category I presume) and sigh with every extra
line of code they think isn't necessary.
It isn't necessary as long as the problem you are trying to solve is general
enough (the majority of the cases IMO).
ASP.NET is trying to place itslef between these 2 approaches and tries to
give the best of both worlds. In the old classic asp days you woul have even
more sighed :)
Check out this tutorial if you still want to bite the bullet :
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx
The first part will get you started and the rest of the chapters will show
you more datagrid power.
Cheers,
Tom Pester
[color=blue]
> Hi all,
>
> I've been writing in ColdFusion for about 6 years now, and now that
> we've installed a Sharepoint Portal Server I'm finding that I need to
> use ASP.Net to make database calls. I'm finding no good documentation
> for someone who hasn't worked with ASP.Net...
>
> In ColdFusion it's a very simple task to pull data from a database...
> just setup the datasource in the CF Admin page and use something like
> this:
>
> <cfquery name="GetData" datasource="MyDS">
> select Firstname, Lastname from Names
> </cfquery>
> <cfoutput query="GetData">
> #Firstname# #lastname#<br>
> </cfoutput>
> But when I try to see how to do this in ASP.Net I found this page on
> MS's website:
http://tinyurl.com/9vk2c
>
> And without even giving any code examples here's what it says:
>
> To access SQL databases from ASP.NET
> 1. Create a database connection using the SqlConnection class.
> 2. Select a set of records from the database using the
> SqlDataAdapter class.
> 3. Fill a new DataSet using the SqlDataAdapter class.
> 4. If you are selecting data from a database for non-interactive
> display only, it is recommended that you use a read-only, forward-only
> SqlDataReader (or OleDbDataReader for non-SQL databases) for best
> performance. When using a SqlDataReader, select the records using a
> SqlCommand query and create a SqlDataReader that is returned from the
> SqlCommand object's ExecuteReader method.
>
> In some cases, such as when you want to sort or filter a set of
> data, you might also want to create a new DataView based on a DataSet
> for the desired table.
> 5. Bind a server control, such as a DataGrid, to the DataSet,
> SqlDataReader, or DataView.
> Why is everything Microsoft touches so freakin' complicated? Is there
> not some sample code I can use that I can simply change my database
> name, server, and login info then create some loop to cycle through my
> data? I'm not writing an entire application, just making a call to a
> database to show on the screen via a DWP page.. I've stayed away from
> Microsoft's programming languages thus far because they are so bloated
> compared to CF, PHP, and even standard C++ when talking about app
> development, but now I'm finding I have to use ASP.Net or similar to
> create database requests with SPS. Am I wrong? Is it simpler them
> MS's tech docs show it to be? Do I need to get a Masters in CS to
> learn this mess?
>
> Thanks for any comments or suggestions... it's gotta be simpler then
> this!
>
> Sam Alex
>[/color]