473,382 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

linq and asp.net

I am starting a new web application and I was planning on using linq but i
have a bunch of problems.
most forms will display some data from the database, but there always has to
be a filtering support - you need to be able to filter the data based on one
or more columns (I make the filter in runtime). The data also has to be paged
(with user selected sort column).

First I wanted to use the LinqDataSource for this, but it does not have a
Refresh method and filtering via parameters from controls doesnt work. I
tried then making my own linq query and binding listview on it, but then
datapager doesnt work properly (that is, it doesnt work at all).

so please help, should i go back to the datasets which require a lot more
work, or is there a way to make use of the linq queries - i need to be able
to make pager work (or some other way to display page numbers and them to be
working links) and to be able to have more fields for filtering?
pls help

thanx in advance,
Nedim
Jan 3 '08 #1
6 1488
"Nedim" <Ne***@discussions.microsoft.comwrote in message
news:57**********************************@microsof t.com...
so please help, should i go back to the datasets which require a lot more
work, or is there a way to make use of the linq queries - i need to be
able
to make pager work (or some other way to display page numbers and them to
be
working links) and to be able to have more fields for filtering?
I think the debate on Linq is likely to become almost as heated as the C# vs
VB.NET debate we started back in 2002 which, thankfully, has pretty much
gone away now...

My personal opinion (so far) is that Linq is superb at allowing .NET objects
to be queried using SQL syntax *as if* they were data tables, but I haven't
really found any need to use Linq to query an actual database... That's
almost certainly because I never go anywhere near the SqlDataSource /
AccessDataSource etc objects - instead, I have a standard DAL which I use
for all database work so, once the connection string is in place, any
individual query is usually just one line of C# code...

There's an interesting take on this here:
http://blogs.msdn.com/ploeh/archive/...Practices.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #2
well my biggest problem is paging (with filtering) and i've always had
trouble doing that. linq seemed like a good solution for that, but there is
just too many unfinished (or maybe things I havent found out yet) to make it
useful for everything - again, i think that filtering and refresh method on
linqdatasource are pretty basic things.
and now with so many new things in .net 3.5 and new project, i want to use
all the benefits of a new enviroment that i can, so I'm still not sure what
to do and how to do it - separate dal project, should the dal use datasets,
linq or both, and what is the best way to do paging - pager control seemed
godsend, but it doesnt work with anything other then linqdatasource.

"Mark Rae [MVP]" wrote:
"Nedim" <Ne***@discussions.microsoft.comwrote in message
news:57**********************************@microsof t.com...
so please help, should i go back to the datasets which require a lot more
work, or is there a way to make use of the linq queries - i need to be
able
to make pager work (or some other way to display page numbers and them to
be
working links) and to be able to have more fields for filtering?

I think the debate on Linq is likely to become almost as heated as the C# vs
VB.NET debate we started back in 2002 which, thankfully, has pretty much
gone away now...

My personal opinion (so far) is that Linq is superb at allowing .NET objects
to be queried using SQL syntax *as if* they were data tables, but I haven't
really found any need to use Linq to query an actual database... That's
almost certainly because I never go anywhere near the SqlDataSource /
AccessDataSource etc objects - instead, I have a standard DAL which I use
for all database work so, once the connection string is in place, any
individual query is usually just one line of C# code...

There's an interesting take on this here:
http://blogs.msdn.com/ploeh/archive/...Practices.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #3
One of the major challenges in asp.net is to keep your lane straight without
making unnecessary turns.

I have an impression that many asp.net innovations target novice developers
or those who switch over from some other technologies. Developers who have
already made their way and style through the years of practical development,
who already know sql, javascript and all sorts of big and little things,
don't need to rush to switch the paradigm of managing everything in
server-side code modules.

In many cases it is better to use natural database queries without
introducing an extra complexity layer and having to pass through yet another
learning curve.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
"Nedim" <Ne***@discussions.microsoft.comwrote in message
news:57**********************************@microsof t.com...
>so please help, should i go back to the datasets which require a lot more
work, or is there a way to make use of the linq queries - i need to be
able
to make pager work (or some other way to display page numbers and them to
be
working links) and to be able to have more fields for filtering?

I think the debate on Linq is likely to become almost as heated as the C#
vs VB.NET debate we started back in 2002 which, thankfully, has pretty
much gone away now...

My personal opinion (so far) is that Linq is superb at allowing .NET
objects to be queried using SQL syntax *as if* they were data tables, but
I haven't really found any need to use Linq to query an actual database...
That's almost certainly because I never go anywhere near the SqlDataSource
/ AccessDataSource etc objects - instead, I have a standard DAL which I
use for all database work so, once the connection string is in place, any
individual query is usually just one line of C# code...

There's an interesting take on this here:
http://blogs.msdn.com/ploeh/archive/...Practices.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #4
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:%2****************@TK2MSFTNGP03.phx.gbl...

I couldn't agree more.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #5
Yup. LINQ is great, LINQ is cool. To write apps with LINQ, you gotta take
time for LINQ school. (boy, that was profound, huh...)
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Mark Rae [MVP]" wrote:
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:%2****************@TK2MSFTNGP03.phx.gbl...

I couldn't agree more.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #6
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:BB**********************************@microsof t.com...
Yup. LINQ is great, LINQ is cool. To write apps with LINQ, you gotta take
time for LINQ school. (boy, that was profound, huh...)
Nah - if you'd wanted to be really cool, you'd have rhymed Bromberg with
homburg... ;-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Johnson | last post by:
Greetings, i want to be able to use linq new technology with sql server. the senario i am not able to do so far is as follow: 1- i program with linq 2- be able to generate and manipulate...
4
by: cj | last post by:
Can I use LINQ in VB .Net 2008 to get to a Visual FoxPro Table? I've seen demos of it with SQL Server but they've used it with a server browser and I don't think that'd work when I need to see VFP...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
0
by: =?Utf-8?B?SHlwZXJjb2Rlcg==?= | last post by:
I'm encountering some strange behavior after deploying a ASP.net 3.5 website to production, i'm unable to reproduce these in my dev environment. This error seems to occur very randomly but it's...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
9
by: Cirene | last post by:
I'm about to begin a brand new, big, ASP.NET project (using 3.5 .net fw), VS 2008. I'm using MySQL as the backend (customer request.) I have absolutely no experience with LINQ and/or the Entity...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
4
by: George | last post by:
I am a bit conservative type and usually give some time for technology to mature before starting to try it. Today my question is Linq. To start using it or not. So here is the voting questions....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.