CREATE TABLE Profiles
(
UniqueID AutoIncrement NOT NULL PRIMARY KEY,
Username Text (255) NOT NULL,
ApplicationName Text (255) NOT NULL,
IsAnonymous YesNo,
LastActivityDate DateTime,
LastUpdatedDate DateTime,
CONSTRAINT PKProfiles UNIQUE (Username, ApplicationName)
)
i mean where to place this code ?? because i cant understand this one..there was written that to issue this code bt where no idea..so m asking for any type of help to tell me..where or in which file i should place this ?? folder was given App_Data now how
to use this..anyone ??
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
my scenario is to enable user profile as the table shows from name..bt i cant see or maybe i just cant figure out how :( what is store procedure ?? and how to call that ??
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
My friend you will need to spend some time to understand the SQL Server and stored procudeures. Stored procdures are set of commands that execute on database. you can refer this link to go through Stored Procedures.
Now once stored procedure is created on Database server we will need to call it from our .NET code so that necessary commands can execute on the database server. Here is how you can do it. Its simple.
yah i knw i will need some time..bt with some time i need someone to guide me .. so i want a link a tutorial or a video to tell me how to send codes to table in database by data-definition..like one in my question..
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
First one will give you an idea about how to write simple stored procedures on database itself. the second link will give you an idea about creation of stored procedures as well as calling them from your code.
In your scenario what you can do is write a stored procedure to create a table as per your requirement and you can simply call your stored procedure from the C sharp/VB code.
Sorry to say brother bt none of codes were telling me how to save the code n where to save the code :(
look at this page too..it also just tells me how to write code..i knw about some datatypes bt i want to knw " WHERE TO SAVE THIS CODE ?? SO THAT IT COULD RUN AND SAVE DATA TO TABLE IN DATABASE! "
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Make tables
Aug 19, 2012 06:35 AM|LINK
how to make a table from this code ??
CREATE TABLE Profiles ( UniqueID AutoIncrement NOT NULL PRIMARY KEY, Username Text (255) NOT NULL, ApplicationName Text (255) NOT NULL, IsAnonymous YesNo, LastActivityDate DateTime, LastUpdatedDate DateTime, CONSTRAINT PKProfiles UNIQUE (Username, ApplicationName) )i mean where to place this code ?? because i cant understand this one..there was written that to issue this code bt where no idea..so m asking for any type of help to tell me..where or in which file i should place this ?? folder was given App_Data now how to use this..anyone ??
~~! FIREWALL !~~
Ramesh Chand...
Star
12922 Points
2672 Posts
Re: Make tables
Aug 19, 2012 07:24 AM|LINK
why you want to execute the SQL command through .net code ? is there any specific scenerio?
solution: put your above code in the sql stroe procedure and call that store procedure from the .net code.
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Make tables
Aug 19, 2012 08:03 AM|LINK
my scenario is to enable user profile as the table shows from name..bt i cant see or maybe i just cant figure out how :( what is store procedure ?? and how to call that ??
~~! FIREWALL !~~
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Make tables
Aug 19, 2012 08:04 AM|LINK
And if allowed .. than how can i put this code to table manually..coz i dont knw what is value for CONSTRAINT
~~! FIREWALL !~~
GaurangNaik
Contributor
2081 Points
498 Posts
Re: Make tables
Aug 19, 2012 09:15 AM|LINK
Hi,
My friend you will need to spend some time to understand the SQL Server and stored procudeures. Stored procdures are set of commands that execute on database. you can refer this link to go through Stored Procedures.
http://msdn.microsoft.com/en-us/library/aa174792(v=sql.80).aspx
Now once stored procedure is created on Database server we will need to call it from our .NET code so that necessary commands can execute on the database server. Here is how you can do it. Its simple.
http://www.codeproject.com/Articles/15403/Calling-Stored-procedures-in-ADO-NET
Hope this helps.
GauranG
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Make tables
Aug 19, 2012 09:19 AM|LINK
yah i knw i will need some time..bt with some time i need someone to guide me .. so i want a link a tutorial or a video to tell me how to send codes to table in database by data-definition..like one in my question..
~~! FIREWALL !~~
GaurangNaik
Contributor
2081 Points
498 Posts
Re: Make tables
Aug 19, 2012 09:22 AM|LINK
Hi,
Please go through the second link which has code as well explaination of the code.
GauranG
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Make tables
Aug 19, 2012 09:23 AM|LINK
m going through the first one at the time..
and second one ummmm explaination about the code transfer from that code to table ??
~~! FIREWALL !~~
GaurangNaik
Contributor
2081 Points
498 Posts
Re: Make tables
Aug 19, 2012 09:28 AM|LINK
Hi,
First one will give you an idea about how to write simple stored procedures on database itself. the second link will give you an idea about creation of stored procedures as well as calling them from your code.
In your scenario what you can do is write a stored procedure to create a table as per your requirement and you can simply call your stored procedure from the C sharp/VB code.
GauranG
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Make tables
Aug 19, 2012 09:31 AM|LINK
Sorry to say brother bt none of codes were telling me how to save the code n where to save the code :(
look at this page too..it also just tells me how to write code..i knw about some datatypes bt i want to knw " WHERE TO SAVE THIS CODE ?? SO THAT IT COULD RUN AND SAVE DATA TO TABLE IN DATABASE! "
http://www.w3schools.com/sql/sql_create_table.asp
can u elaborate where to save this code ?? the code to write data to table..
~~! FIREWALL !~~