. NET Operational Database

Source: Internet
Author: User

1.

Some of the automated biochemical queries

Query statements can be customized

2. Custom query Procedure Calls

Use [Mydb]go/*** * * * object:storedprocedure [dbo].    [Proclogin] Script date:08/14/2017 19:18:31 * * * * **/SET ansi_nulls ongoset quoted_identifier Ongo--=============================================--Author: <author,,name>--Create Date: <create Date,,&gt ;--Description: <description,,>--=============================================ALTER PROCEDURE [dbo]. [Proclogin] @userName varchar (50), @password varchar (50) Asbegin--SET NOCOUNT on added to prevent extra result sets from--interfering with SELECT statements.    SET NOCOUNT on; --Insert statements forprocedure here SELECT* FROM [user] WHERE user_name = @userName and password =@passwordEND

Call

Sqlconneteion conn = new SqlConnection ("Database Information"); SqlCommand command = new SqlCommand ("Stored Procedure name", conn) command. CommandType = CommandType.StoreProcedure.command.Parameter is. ADD (New SqlParameter ("@userName", UserName)); Sqlreader dr = Command.ExecuteReader ()
One line read read not to return false

Get the value of the place parameter

SqlParameter count = new SqlParameter ("@count", 0);
Count. Direction = System.Data.ParameterDirection.Output;
Command. Parameters.Add (count);

int a= count.value ();

. NET Operational Database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.