Posts

Showing posts from March, 2017

Find string and cut string its reach the particular string

Api Methods         [HttpPost]         [Route("Postmetods")]         public string Getmethod([FromBody] dynamic data)         {             // dynamic to string conversion             string swap = Convert.ToString(data);             //check the particular present or not it return bool value             bool ee = swap.Contains("200");             //body after it will remove before string             string s = swap.Substring(swap.LastIndexOf("body"));            //if present it will show execute Yes else No             if (ee != false)             {                 return "Yes"; ...

my reframce

use ReportServerTempDB select *from dbo.ChunkData INNER JOIN [ChunkSegmentMapping] on ChunkSegmentMapping.ChunkId = ChunkData.ChunkID INNER JOIN [PersistedStream] on PersistedStream.SessionID = ChunkData.SnapshotDataID use ReportServerTempDB select *from dbo.Segment select *from dbo.ChunkData alter procedure selectsubquery as declare @department varchar(50) begin --select *from dbo.Segment where SegmentId = (select *from  dbo.Segment where Content= @department) select * from SegmentId where emp_add =(select *  from dbo.Segment where Content =@department) end exec selectsubquery "1" create view selectall as select *from Segment select *from selectall drop view selectall drop procedure selectsubquery create index test_index on ChunkData(SnapshotDataID) drop index ChunkData.test_index select *from dbo.Segment create database testdbset create table userse (userid int ,name varchar(50)) drop table users select * from users --insert into use...

Asp.net Web form curd operation using store procedure

Image
        using System;         using System.Collections.Generic;         using System.Data;         using System.Data.SqlClient;         using System.Linq;         using System.Web;         using System.Web.UI;         using System.Web.UI.WebControls;         namespace WorkProgras         {             public partial class gridview : System.Web.UI.Page             {                 SqlCommand cmd = new SqlCommand();                             protected void Page_Load(object sender, EventArgs e)                 {               ...

multiple table joins

Entity Creation: create table product( pid int identity, p_name varchar(200), CONSTRAINT product_pk PRIMARY KEY (pid)    ) create table purchase( pid int primary key identity, p_quantity varchar(200), CONSTRAINT purchase_pk PRIMARY KEY (pid)     ) create table sales( pid int primary key identity, p_amount decimal(18,2), CONSTRAINT sales_pk PRIMARY KEY (pid)   ) Foreign Key Relation: use SalesDb alter table purchage add constraint purchase_fk foreign key(pid) REFERENCES product(pid); alter table sales add constraint sales_fk foreign key (pid) REFERENCES product(pid); joins the tables: select product.pid,product.p_name,sales.p_amount,purchase.p_quantity from  product inner join purchase on product.pid = purchage.pid inner join sales on product.pid = sales.pid view creation: create view joinsview as select product.pid,product.p_name,sales.p_amount,purchage.p_quantity from  product inn...

Asp.net Web form CURD Operation Using Store Procedure

Store Procedure Syntax: CREATE { PROCEDURE | PROC } [schema_name.]procedure_name [ @parameter [type_schema_name.] datatype [ VARYING ] [ = default ] [ OUT | OUTPUT | READONLY ] , @parameter [type_schema_name.] datatype [ VARYING ] [ = default ] [ OUT | OUTPUT | READONLY ] ] [ WITH { ENCRYPTION | RECOMPILE | EXECUTE AS Clause } ] [ FOR REPLICATION ] AS BEGIN [declaration_section] executable_section END; schema_name The name of the schema that owns the stored procedure. procedure_name The name to assign to this procedure in SQL Server. @parameter One or more parameters passed into the procedure. type_schema_name The schema that owns the data type, if applicable. datatype The data type for @ parameter . VARYING It is specified for cursor parameters when the result set is an output parameter. default The default value to assign to @ parameter . OUT It means that @ parameter  is an output parameter. OUTPUT It means that @ parameter ...