Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 stored procedures

Author  Topic 

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 06:04:12
I have 2 forms login form and member form , if a member login in a login form iwant to populate members details in the form member.
how can i do this with stored procedure

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 06:04:53
what all data you want to populate? what are fields of memeber table?
Go to Top of Page

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 06:17:10
Here are the attribute of member ,the member login using Surname and a MembershipNum in the form login:
Create table Member
(
MembershipNo int identity(010,1)Not null,
Title varchar(5),
FirstName varchar(30),
Surname varchar(30),
MembershipNum int Not Null,
IDNumber varchar(13),
DOB varchar(15),
Languages varchar(30),
Gender varchar(6),
Occupation varchar(20),
CellNumber varchar(10),
Work_Tel varchar(10),
Home_Tel varchar(10),
E_mail varchar(30),
Hobbies varchar(30),
MemberShipOfOrg varchar(30),
R_Address varchar(60),
R_Code int Not Null,
Postal_Address varchar(60),
Postal_Code int Not Null,
DateCreated Datetime default getdate(),
WardNo int Not Null,
Constraint Member_pk Primary key clustered(MembershipNo)
);
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 06:19:02
what will you be passing from form?
Go to Top of Page

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 06:23:41
i will pass MembershipNum

quote:
Originally posted by visakh16

what will you be passing from form?

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 06:30:31
quote:
Originally posted by Mpilo

i will pass MembershipNum

quote:
Originally posted by visakh16

what will you be passing from form?





replace * by columns you want.
Go to Top of Page

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 06:40:16
How can i login in another form show details in another form

quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo

i will pass MembershipNum

quote:
Originally posted by visakh16

what will you be passing from form?





replace * by columns you want.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 06:48:02
quote:
Originally posted by Mpilo

How can i login in another form show details in another form

quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo

i will pass MembershipNum

quote:
Originally posted by visakh16

what will you be passing from form?




you need to call this sp from form passed memnum of logged in person and retrieve deatils and display it.

replace * by columns you want.



Go to Top of Page

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 07:04:43

how to pass this variable in another form


quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo

How can i login in another form show details in another form

quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo

i will pass MembershipNum

quote:
Originally posted by visakh16

what will you be passing from form?




you need to call this sp from form passed memnum of logged in person and retrieve deatils and display it.

replace * by columns you want.





Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 07:12:06
quote:
Originally posted by Mpilo


how to pass this variable in another form


may be as a query string parameter . which language you're using?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-29 : 07:12:08
I would advice you read up on .net's membership providers.

Microsoft has simplified your request in .net 2.0
Go to Top of Page

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 07:12:18
i need to pass my stored procedure in form.populate data without entering any data.how can i do it

quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo

How can i login in another form show details in another form

quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo

i will pass MembershipNum

quote:
Originally posted by visakh16

what will you be passing from form?




you need to call this sp from form passed memnum of logged in person and retrieve deatils and display it.

replace * by columns you want.





Go to Top of Page

Mpilo
Yak Posting Veteran

52 Posts

Posted - 2008-09-29 : 07:15:54
i'm using C# and sqlserver

quote:
Originally posted by visakh16

quote:
Originally posted by Mpilo


how to pass this variable in another form


may be as a query string parameter . which language you're using?

Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-29 : 07:23:13
Are you using winforms or webforms ?

As I adviced, if you are using webforms in c#, I would advice you to use Micorosft memebership provider. It...

1. Creates your database for you (encrypts your passwords)
2. Secures your site
3. Simplifies your frontend code

So you dont need to call stored procedures to do your work. But with one line of code you can create your users (encrypt passwords) and your user profiles

Memebrship.Createuser("username","password","email@yourdomain.com");

Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-29 : 07:25:54
quote:
Originally posted by visakh16

may be as a query string parameter . which language you're using?



Thats not a good idea, there are far more advanced methods.

To pass values, use

string variable;
variable = Your_control.Text.ToString();
Go to Top of Page
   

- Advertisement -