|
-
Aug 16th, 2011, 05:01 PM
#5
Banned
Re: Can you help me find a good starter tutorial on databases?
SQL STORED PROCEDURES
in asp.net : after connecting to the sql database :
right click stroed procedure, add.
type :
create procedure dbo.name
@columnname varchar(60)
as
select column1, column2 from tablename
where columnname = @columnname
return
you can right click and execute to test
ctrl + shift + a or add new item, linq to sql classes
right click GUI to show methode pane, drag the created stored procedure into the pane
add to the form a data grid view control, and a text box
in the code (for vb code) :
private records as new contactbasedatacontext
'as global variable
' in an event like button event
dim rec = records.selectcontact(textbox1.text)
datagridview1.datasource = rec
' run , put parameter in textbox1 click button to run event code
2nd example of stored procedure :
alter procedure dbo,insertnojutsu
@param1 varchar(49)
@param2 varchar(30)
as
insert into tablename(param1,param2)
where (@param1,@param2)
return
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|