Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 July 13th, 2004, 08:37 PM
Authorized User
 
Join Date: Jun 2004
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Raif
Default Sql statements in data adapter

can you use all the same sort of select query functions in ado.net as you can in sql server? for instance I want to pull a dataset from a database using a sql statement that groups by and counts different columns. This statement works in sql server "SELECT PKDate, COUNT(S1Tr) AS S1Sum, COUNT(S2Tr) AS S2Sum, COUNT(S3Tr) AS S3Sum FROM(tblSlots)GROUP BY PKDate"
it groups by pkdate and creates new columns S1Sum etc as counts of S1Tr etc. but my asp.net page will have none of it.
Also where can I get the syntax and restrictions for my select statements in .net? I have seen all manner of different versions such as using [] on all tables and fields. including the table.field for every field even if you are only using one field etc. Is there some comprehensive rule set somewhere?
Thanks
Raif

 
Old July 14th, 2004, 08:50 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The query you use in .NET is dependant on the underlying database system. If you are using MSSQL, feel free to use any MSSQL specific syntax. ADO.NET shouldn't restrict you. The [] you might see are again a database specific syntax. In MSSQL (and probably others) if you give a field or table a name that matches one of the MSSQL keywords you would wrap it in [] so MSSQL knows you mean a field or table name. (i.e.: SELECT [SELECT] FROM [SELECT])





Similar Threads
Thread Thread Starter Forum Replies Last Post
filling the combobox using sql data adapter kumaran BOOK: Professional .NET 2.0 Generics 4 October 5th, 2015 07:57 AM
Data Adapter k_kosaraju ADO.NET 1 October 31st, 2004 09:51 AM
Adapter for SQL erisa Biztalk 3 February 25th, 2004 09:28 AM
SQL Data Adapter jbenson001 ASP.NET 1.x and 2.0 Application Design 6 December 18th, 2003 12:13 PM





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