well, the reason why i think i should do it programatically is due to the following scenario.
every new inventory site created will have a list of inventories that might contain thousands of data.
im thinking that if i put all the inventories from all inventory sites into one database table, there might be performance issues as the total combined records from all the inventory sites will be in great numbers.
This leads me to the idea that every new inventory site created will automatically create a new database table just for that site to store its individual records.
None
0 Points
16 Posts
programatically add database table
Aug 11, 2010 09:50 PM|pothios|LINK
hi,
im exploring the feasibility of adding database tables programatically. just wondering if there's any issue that might arise if i adopt this design.
Thanks.
All-Star
37505 Points
8109 Posts
Re: programatically add database table
Aug 11, 2010 10:34 PM|sansan|LINK
I think you may have to create new tables before you start developing a web application/website.
If you need to alter any table to suit your development issues, you can do it in the backend.
I don't think there will be any need to do it programmatically.
does that make sense??
None
0 Points
16 Posts
Re: programatically add database table
Aug 11, 2010 10:46 PM|pothios|LINK
well, the reason why i think i should do it programatically is due to the following scenario.
every new inventory site created will have a list of inventories that might contain thousands of data.
im thinking that if i put all the inventories from all inventory sites into one database table, there might be performance issues as the total combined records from all the inventory sites will be in great numbers.
This leads me to the idea that every new inventory site created will automatically create a new database table just for that site to store its individual records.
Contributor
7260 Points
1902 Posts
Re: programatically add database table
Aug 15, 2010 09:27 AM|nareshguree23@gmail.com|LINK
for create a table in database using code
you need to create a string for create table
string strquery="CREATE TABLE [tblLogin](
[UserRegId] [nvarchar](9) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UserName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Password] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[EmailID] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_tblLogin] PRIMARY KEY CLUSTERED ( [UserRegId] ASC)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]"
and execute the string with command object
like
SQLCommand cmd= new SQLCommand(strquery, conn)
cmd.ExecuteNonQuery();
<div></div>