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

Wednesday, March 28, 2012

How to assign SQL query to Button in asp.net 2.0

Hi

My webpage contain three dropdown box and one button. One dropdown to choose hospital_id, second dropdown to choose project_id and third dropdown to choose version_no .After choosing these three and when the button is clicked i want to run this sql query

INSERT INTO version(project_id,hospital_id,date_created,comments) SELECT project_id,hospital_id,date_created,comments FROM version whereversion_no=@.version_no andproject_id=@.project_id andhospital_id=@.hospital_id.

Just i need the code in asp.net 2.0 , VB , when the button is clicked the above query should run and the parameters (values) should take from dropdown box.

Could anyone please send the solution for the above problem.

write the query like this

Dim sQuery as String = "INSERT INTO version(project_id,hospital_id,date_created,comments) SELECT project_id,hospital_id,date_created,comments FROM version whereversion_no=" + ONE_DropDown.SelectedValue + "andproject_id=" + Second_DropDown.SelectedValue + "andhospital_id=" +THIRD_DropDown.selectedValue

Try this query

Monday, March 12, 2012

how to add login user (ASPNET) to MS SQL 2000 Desktop Engine server (MSDE2000)?

How do I add login user ASPNET to my SQL 2000 Desktop Engine Server?. I can not find the "Server Manager" in the Start - Programs. Is there any other way to get around adding ASPNET login to the SQL server so I can test my VB program. I got the error: Login failed for user 'com_name\ASPNET'.Use OSQL, a command line tool. Find it, and from the command prompt:

osql -S servername\instancename -E -q
--Line numbers will appear
EXEC sp_grantlogin 'com_name\ASPNET'
go
use <databasename>
go
EXEC sp_grantdbaccess 'com_name\ASPNET'
go
EXEC sp_addrolemember 'db_owner', 'com_name\ASPNET'
go

Friday, March 9, 2012

how to add aspnet user to sqlexpress

Hi guys

I am trying to add aspnet user to sqlexpress. I am able to select the asp.net however when I click on OK button,

it is asking me to enter a name for it. COuld you tell me what name I should enter? I tried computername\aspnet didn't help?

is there better way to do this?

thanks for your help

Cemal

Hi patron,

What are the steps you did for creating user? We can simply create user by following steps:

In Management Studio, locate to Server name | Security | Logins, right click Logins node and select "New Login…", click Search button in General panel. Then the "Select User or Group" dialog appears. Please be sure the location is your computer name. Input ASPNET or Network Service in the TextBox and then click "Check Names".

How to Add ASPNET account to your database

This is the error message "Login failed for user 'SUSHMA\ASPNET'. "

I am Building a Data Form that displays data from a single table- the Customers table in the Northwind sample Database.

I have Visual Studio.Net 1.0 and SQL Server 2000.

So I feel that I need to add an ASPNET account to my database.

Please could someone tell me if this could solve the problem, if so

please could you tell me how to Add an ASPNET account to my database?

Thank you

This thread has instructions on how to grant database access to a user account.
http://forums.asp.net/875897/ShowPost.aspx
|||

Hi,

Use Enterprise Manager (in SQL Server) to look at the users and groups for the database in question. If you don't see ASPNET there, you can add it, if it is there, it may be that it doesn't have sufficient permissions to do what you are asking it to do. The other thing to check applies if you are using IIS 6 (Win2k3 Server). In this case, ASP.NET uses NETWORK SERVICE, rather than ASPNET as the default worker process.

Hope it helps.

Sunday, February 19, 2012

How to access the SQL mobile database(.sdf) using ASP.Net?

How to access the SQL mobile database(.sdf) using ASP.Net?

When i try to add the System.Data.SqlServerCe.dll as a Reference it shows the following error.

Error 1 Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

You must browse to this folder: C:\Programmer\Microsoft SQL Server Compact Edition\v3.1 and add the reference from there. In addition, you must follow the instructions in this article http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlceconnection.aspx if you want to use the SqlCeConnection. Also note the advice on performance problems with SQL CE and asp.net. Please not there is a documentation error, see here for the correct syntax:

http://msdn2.microsoft.com/en-us/library/ms174612.aspx