Monday, March 19, 2012
Assing rows to a table
rows are customers. It stores sales info by customer and
product. I would like to add a row at the bottom af my
customer list that would be used for totaling each
column. Does anyone know how I can do this?
hi john,
if i understand you correctly you are looking for COMPUTE BY clause of
SELECT statement.
you can check the resultset of following query on northwind database.
use northwind
go
select b.customerid, a.unitprice
from [order details]a join orders b
on a.orderid =b.orderid
order by b.customerid
compute sum (a.unitprice ) by b.customerid
go
if this is not what you want pls post relevent table structure, sample
records, and expected result set out of it.Also specify whether you can
looking for in INSERT /UPDATE/SELECT statment.
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com
Friday, February 24, 2012
ASPNETDB.MDF ... whyyyy? :(
I have my own database file, but when I run my site in debug mode it creates aspnetdb.mdf again and stores all users in there ... question is - why? :((
I've attached my own db to sql server express, ran "aspnet_regsql.exe -W" on it, so it got all the schema in there.
Here's what I have in my web.config
----
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=ME\SQLEXPRESS;Initial Catalog=myOwnDB;Persist Security Info=True;User ID=user;PWD=password" providerName="System.Data.SqlClient"/>
</connectionStrings
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
requiresUniqueEmail="true"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
applicationName="/" />
</providers>
</membership>
----
so i connect straight to sql server, not local file (so i dont have to attach / detach the db all the time)
but when i create new user through ASP Config, it creates them in aspnetdb.mdb file :(
can anyone explain me what im doing wrong here?
thanks in advance!
As I know the aspnet_regsql.exe utility is used to create schema for hosting asp.net data in a specific database, and it doesn't mean all your web applications will push the data into the database specified by aspnet_regsql.exe. This article shows how to customize the database for storing aspnet data:
http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
Thursday, February 16, 2012
ASP.NET SQL Server Setup: stores one created database information for ASP.NET applications servi
Hi everybody,
o.k, with the aspnet_regsql wizard it′s easy to configure a SQL Server database that stores information for ASP.NET applications services. I did it for my database AppServicesDB.
In VS2005 I wrote 2 applications using the same AppServicesDB as Membership-Provider.
When I use the web admin tool ASP.NET Configuration for the first application, I created the roles and users for this first application. All looks to be o.k.
But when I used ASP.NET Configuartion for the second application (pointing in at the same AppServiesDB), the roles and useres of the first application are visible as if they are members of the second application.
Questions:
Is it possible or necessary to configure many databases (with aspnet_regsql) for every single application on a machine, so that on the machines SQL server exists many databases for ASP.NET applications services?
Or is only one database responsible for the machines SQL Server to be the memebership-Provider for all applications?
Thanks for help, support, assistance...
I guess it would be better to post this on ASP.NET forums. This forum is for answering questions related to CLR Integration in SQL Server 2005.Thanks,
-Vineet.