473,396 Members | 2,023 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,396 software developers and data experts.

alternate to AccessDataSource

145 100+
I got this from http://www.codeproject.com/KB/aspnet...dGridView.aspx. I dont like using accessdatasource. What are my option? (what I really like is to create a class and create object in the form, my backend is sql server. Can anyone please please help?)
Thanks
<Do>
Expand|Select|Wrap|Line Numbers
  1.     private AccessDataSource ChildDataSource(string strCustometId, string strSort)
  2.     {
  3.         string strQRY = "";
  4.         AccessDataSource dsTemp = new AccessDataSource();
  5.         dsTemp.DataFile = "App_Data/Northwind.mdb";
  6.         strQRY = "SELECT [Orders].[CustomerID],[Orders].[OrderID]," +
  7.                                 "[Orders].[ShipAddress],[Orders].[Freight],[Orders].[ShipName] FROM [Orders]" +
  8.                                 " WHERE [Orders].[CustomerID] = '" + strCustometId + "'" +
  9.                                 "UNION ALL " +
  10.                                 "SELECT '" + strCustometId + "','','','','' FROM [Orders] WHERE [Orders].[CustomerID] = '" + strCustometId + "'" +
  11.                                 "HAVING COUNT(*)=0 " + strSort;
  12.  
  13.         dsTemp.SelectCommand = strQRY;
  14.         return dsTemp;
  15.     }
Jun 10 '09 #1
2 2098
Frinavale
9,735 Expert Mod 8TB
What are you binding to?
Check out this article about binding. You can bind to any Object....

If you're using something like a GridView, it will automatically bind to any public properties of the Object that is the DataSource.
Jun 16 '09 #2
dorandoran
145 100+
thanks frin. man, you went through so many post and answered them. it's nice of you.
Jun 16 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: podong28 | last post by:
I want to connect mdb. not accessDataSource asp.net 2.0 nothing? I tried SqlDataSource. I Failed Thanks @podong28
0
by: msnews.microsoft.com | last post by:
I've got a paging and sorting enabled GridView whose datasource is and AccessDataSource. I build the SelectCommand at PageLoad - it's a union query to show items and comments of the user logged...
4
by: Luqman | last post by:
How can I display any field value in textbox of sqldatasource using VS.Net 2005 ? Say : Dim x as new AccessDataSource X.connectionstring="Data source="D:\mydb.mdb" X.Selectcommand="Select...
1
by: Jim McGivney | last post by:
In VS'05 I have an aspx page with a label that I am trying to populate from a field (Last) in table (Ante_Pedigree) from an Access database. In C# in a code-behind I run: AccessDataSource...
0
by: Jim McGivney | last post by:
In Using VWD I have found it very easy to associate an Access Database with gridview and detailsview controls to view and manipulate data. There are times when I need to programmatically obtain...
1
by: mosscliffe | last post by:
I am trying to filter an accessdatsource by adding a FilterExpression If I have Field = 2 It works fine If I have Field IN (1,5,7) it works fine So now I want it to reference a...
0
by: DC | last post by:
Why would this code give me the error "Could not load type System.Web.UI.WebControls.AccessDataSource from assembly System.Web, Version=1.0.5000.0" at line 16... <form id="form1"...
4
by: msch-prv | last post by:
I use an Access db in my application. So far I have been exclusively working wtih the AccessDataSource controls to hook up to the db. I know that Access db connections can also be established with...
0
by: mlfblom | last post by:
Hi, I know I am not the only one struggling with the following, but so far I have not seen a solution. Problem: I have an asp.net 2.0 web page with a gridview which is bound to an...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.