stored procedure is like function call,
there are n number of queries u may use in your work.. You just define (or) stored in a form..
For example .. The following is just a idea,not exact syntax..
1.select * from tbl_table
2.select a.a_id,b.name from tbl_a as a inner join tbl_b as b on a.a_id=b.a_id
3.select a_id from tbl_a where a_id=@a_id
The above are query..
In ur wrk u write each time
Forms in c# by Query
form-1
{
string query="select * from tbl_table" ;
--------
----
---
string query="select * from tbl_table" ;
---------
------
string query="select a.a_id,b.name from tbl_a as a inner join tbl_b as b on a.a_id=b.a_id" ;
----
}
form-2
{
---------
------
string query="select a.a_id,b.name from tbl_a as a inner join tbl_b as b on a.a_id=b.a_id" ;
}
So we have to go with stored procedure we just define
value=1 is select * from tbl_table
value=2 is select a.a_id,b.name from tbl_a as a inner join tbl_b as b on a.a_id=b.a_id
value=3 is select a_id from tbl_a where a_id=@a_id
Now we just call defined at wherever we need
Forms in c# by Stored Procedure
form-1
{
commandType=storedprocedure;
value=1
.........
value=2
....
value=3
.....
value=1..
}
Form-2
{
value=3
.....
}
For each form u may tired on writing query ,Wherever u need just take from the procedure which was stored by u...
Its not a perfect syntax just an Idea not exact syntax