Showing posts with label aspnet. Show all posts
Showing posts with label aspnet. Show all posts

Monday, March 19, 2012

Deploying SQL Express with ASP.Net Application

I have a small ASP.Net application developed in VS 2005 that I would like to deploy with SQL Express.

I have included the MDF file in the Application and added SQL Express as a pre-requisite for the Setup and Deployment project.

It installs SQL Express but when it tries to connect I receive:
"This is not a valid login Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITY\SYSTEM'."

I don't seem to have any options using the "prerequisite options in VS 2005 in terms of command line deployment parameters.

Likewise I would prefer to attach the database to the instance (because I need to write a connection string from a PDA using RDA and I have zero clue how to do RDA directly back to the file).

Thanks for any help!
If you do not impersinate the user within your Asp application, the service account which the ASP Service is running with is used to connect to the SQL Server. If this account is not priviledged to access the server, you will get the mentioned error message. I don′t know how your application design is, but if you want to leave it as it is, you will have to grant access for the SYSTEM account to the server.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Friday, February 24, 2012

Deploy SQL Server Database in an ASP.NET Application?

hi

i want to develop a web application that use SQL Server Database, i have installed SQL Server & VS.NET in my local computer and i'm ready to develop, but before getting started, i want to know how i will upload mydatabae in my host,

actually i want to know should i know the settings & properties of my host that support SQL Server, or without know them i can devekop my apploication and after developing localy with just a few tasks upload my ( Sql Server) database???

i'm worry actually about this, plz say what you know about this.
thanks>>should i know the settings & properties of my host that support SQL Server

Yes, contact your hosting provider, or several, to get this information.

Sunday, February 19, 2012

Deploy db to client with users?

I have a db with test data, and a .NET app for it's use. How do I pass
over
users with the db, and how to I get MachineName\ASPNET as a user in that
install?
TIA
__Stephen
See if this helps:
HOW TO: Move Databases Between Computers That Are Running SQL Server
http://support.microsoft.com/default...b;en-us;314546
AMB
"Stephen Russell" wrote:

> I have a db with test data, and a .NET app for it's use. How do I pass
> over
> users with the db, and how to I get MachineName\ASPNET as a user in that
> install?
> TIA
> __Stephen
>
>

Deploy db to client with users?

I have a db with test data, and a .NET app for it's use. How do I pass
over
users with the db, and how to I get MachineName\ASPNET as a user in that
install?
TIA
__StephenSee if this helps:
HOW TO: Move Databases Between Computers That Are Running SQL Server
http://support.microsoft.com/defaul...kb;en-us;314546
AMB
"Stephen Russell" wrote:

> I have a db with test data, and a .NET app for it's use. How do I pass
> over
> users with the db, and how to I get MachineName\ASPNET as a user in that
> install?
> TIA
> __Stephen
>
>

Deploy db to client with users?

I have a db with test data, and a .NET app for it's use. How do I pass
over
users with the db, and how to I get MachineName\ASPNET as a user in that
install?
TIA
__StephenSee if this helps:
HOW TO: Move Databases Between Computers That Are Running SQL Server
http://support.microsoft.com/default.aspx?scid=kb;en-us;314546
AMB
"Stephen Russell" wrote:
> I have a db with test data, and a .NET app for it's use. How do I pass
> over
> users with the db, and how to I get MachineName\ASPNET as a user in that
> install?
> TIA
> __Stephen
>
>

Deploy a database and ASP.NET site to GoDaddy.com

I have a vb.net web page which I created (a shopping cart). I created this site using vb.net 1.1 and SQL 2000 on my laptop. On my laptop everything works properly, but when I tried moving it to GoDaddy (http://currahee3-506.org/px/default.aspx). In the code, each query to the SQL server is done using stored procedures.

When you first go the page, a drop down is presented. When you select "Shirt" from the category drop down. A second drop down menu is then displayed and will let you select what type of shirt you are interested in purchasing. Select Polo Shirt Without Pocket. Upon doing so, I receive an error message:

Invalid object name 'tbl_LookupCategory'.
Invalid object name 'tbl_pxProducts'.
Invalid object name 'tbl_LookupColor'.
Invalid object name 'tbl_LookupSizes'.
Invalid object name 'tbl_pxQtySold'.
Invalid object name 'tbl_pxImages'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Invalid object name 'tbl_LookupCategory'.
Invalid object name 'tbl_pxProducts'.
Invalid object name 'tbl_LookupColor'.
Invalid object name 'tbl_LookupSizes'.
Invalid object name 'tbl_pxQtySold'.
Invalid object name 'tbl_pxImages'.

Source Error:

Line 143: sqlCommand.Parameters.AddWithValue("@.str_ItemName", Trim(DDL_Items.SelectedItem.Text))Line 144:Line 145: Dim dataReader As SqlDataReader = sqlCommand.ExecuteReader(CommandBehavior.CloseConnection)Line 146:Line 147: dl_Description.DataSource = dataReader


Source File:d:\hosting\currahee\px\default.aspx Line:145

Keep in mind the Stored Procedure works in my testing environment, but not on GoDaddy. I moved the selected statement into a view on the GoDaddy SQL server, and the view worked perfectly. The tables do exist on the GoDaddy SQL Server.

This is the Stored Procedure:

CREATE PROCEDURE [dbo].[sp_GetItemInfo]


@.str_ItemName VarChar(50)


AS


SELECT TOP 100 PERCENT
tbl_pxProducts.int_ItemID,
tbl_pxProducts.str_ItemName,
tbl_pxProducts.int_RetailPrice,
tbl_pxImages.str_SmallImageURL,
tbl_pxImages.str_MediumImageURL,
tbl_pxImages.str_MediumImageBackURL,
tbl_pxImages.str_LargeImageBackURL,
tbl_pxImages.str_LargeImageUrl,
tbl_pxImages.str_SmallImageBackURL,
tbl_pxProducts.int_Quantity - tbl_pxQtySold.int_QtySold AS int_QtyAvailable,
tbl_LookupCategory.str_Category,
tbl_pxProducts.Int_SizeID,
tbl_LookupSizes.str_Size,
tbl_pxProducts.Int_ColorID,
tbl_LookupColor.str_Color


FROM
tbl_LookupCategory
INNER JOIN
tbl_pxProducts
ON
tbl_LookupCategory.int_CategoryID = tbl_pxProducts.int_CategoryID
INNER JOIN
tbl_LookupColor
ON
tbl_pxProducts.Int_ColorID = tbl_LookupColor.int_ColorID
INNER JOIN
tbl_LookupSizes
ON
tbl_pxProducts.Int_SizeID = tbl_LookupSizes.int_SizeID
LEFT OUTER JOIN
tbl_pxQtySold
ON
tbl_pxProducts.int_ItemID = tbl_pxQtySold.int_ItemID
LEFT OUTER JOIN
tbl_pxImages
ON
tbl_pxProducts.int_ItemID = tbl_pxImages.int_ItemID


WHERE
(tbl_pxProducts.int_Quantity - tbl_pxQtySold.int_QtySold > 0)
AND
(tbl_pxProducts.str_ItemName = @.str_ItemName)

ORDER BY
tbl_LookupSizes.str_Size

Does anybody have any suggestions as to why this stored procedure is failing?

If you are sure that the tables exist then make sure you have the permissions to view/manage these tables.

The best what you can do here is to contact godaddy's support.

Regards

Friday, February 17, 2012

Depending on the selection of the user of the asp.net web-form how can i do changes in the

Hi frdz,
  I have created the following stored procedure in sql server 2005.
 In my database i have one option for the payment mode which can be done thru cash or credit(cheque).  
 I have created my web-application in asp.net with C# 2005.
 There i have a dropdownlist box for the user to select the option whether wants to do the payment thru cash or cheque.
Depending on that selection if user selects cheque then all the reqt for cheque like it's no,dt,bankname etc...are visible.
but if user selects the option as cash then the cheque details become invisible.
Depending on the selection of the user of the asp.net web-form how can i do changes in the stored procedure...  
 
i can write the condition like
if paymentmode=cash
then ........
else
..........
but where and how can it be written ...pls tell me
thanxs in adv...u can go thru my below SP  
 
 
 
ALTER PROCEDURE MiscellaneousStoredProcedure @.miscidint output, @.storenamevarchar(20),--store name to storeid @.accountnamevarchar(20), @.groupnamevarchar(20), @.paymentdtdatetime,@.payeenamevarchar(30),@.paymodevarchar(20),@.banknamevarchar(50), @.chqdtdatetime, @.chqnovarchar(20), @.amtnumeric(10, 2),@.balnumeric(10, 2), @.remarksvarchar(50)asdeclare@.storeidint,@.accountidint,@.groupidintbeginset nocount onselect @.miscid =isnull(max(@.miscid),0) + 1from miscellaneourpayifexists (select *from storemasterwhere storename = @.storename)select @.storeid = storeidfrom storemasterwhere storename = @.storenameifexists (select *from accountmasterwhere accountname =@.accountname)select @.accountid = accountidfrom accountmasterwhere accountname =@.accountnameifexists (select *from accountgroupmasterwhere groupname=@.groupname)select @.groupid=groupidfrom accountgroupmasterwhere groupname=@.groupnamebegin transactioninsert into miscellaneourpay(miscid,storeid,accountid,groupid,paymentdt,paymode,payeename,bankname,chqdt,chqno,amt,bal, remarks)values( @.miscid,@.storeid,@.accountid,@.groupid,@.paymentdt,@.paymode,@.payeename,@.bankname,@.chqdt,@.chqno,@.amt,@.bal,@.remarks)commit transaction end
What about creating two different stored Proceedures for both cases?|||

Hi,

Try to use two different stroed procedure for cash and credit. The value from your DropDownList decides which one to use. In this way,you can make your stored procedure easier.

Thanks.