Click here to Skip to main content
15,878,953 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
suppose if a user is signup into website, automatically table has to be created for their login account in database in C# & the table name should be user id name...automatically it has to use the name to create table...

What I have tried:

please any one help me....how to do this
Posted
Updated 28-Nov-16 7:53am
Comments
Developer29 28-Nov-16 8:13am    
I want full code

Are you serious? A new table for every new sign-up? No! it should be a new record for every new signup in a database table. Suggest you read up on database design first Introduction to database design[^], then take a walk-through with this Simple User Registration Form Example in ASP.Net[^]
 
Share this answer
 
v2
Comments
Developer29 28-Nov-16 8:06am    
I want separate table for each user.I want to store more data's for each user because it has to be display in separate webform.
Peter Leow 28-Nov-16 8:12am    
You are totally wrong! A database table is unlike an excel sheet. In relational database design, you have to break down users' related data into multiple related tables, depending on the requirements, one table may contain users' bio-data, another their qualifications, another their employment histories, blah...blah... You then pull the necessary data from some of these table to display on web forms. Start learning the correct way of database design, visit the links that I have provided you in Solution 1.
Developer29 28-Nov-16 8:15am    
i want to add some products details into cart for specific user separately...how to do?
Peter Leow 28-Nov-16 8:19am    
One should not attempt to jump into a deep pool before learning the correct way and basic of swimming.
Quote:
I want full code
You only want someone to do your job. Try to hire a real programmer.
Hire Freelancers & Find Freelance Jobs Online - Freelancer[^]

Quote:
suppose if a user is signup into website, automatically table has to be created for their login account in database
Looks like you need to learn how to design databases, the way you want to use it simply defeat all optimizations.
 
Share this answer
 
Hi,

Please refer below url and just pass username as table name in the code.


Create and Drop SQL Server Table programmatically using ADO.Net, C# and VB.Net[^]


Thanks,
:)
 
Share this answer
 
Comments
Peter Leow 28-Nov-16 8:13am    
Read the question in context, do not stop at the title.
$*Developer - Vaibhav*$ 28-Nov-16 9:05am    
sure Peter :)

Thanks
just create Script of Table and put UserName in [tableName] and excute it every time if user signup.
SQL
CREATE TABLE [tableName](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [Varchar(50)] NOT NULL
	)
 
Share this answer
 
Comments
Developer29 28-Nov-16 8:09am    
I'm not understanding...can you explain me
Peter Leow 28-Nov-16 8:13am    
Read the question in context, do not stop at the title.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900