Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 19, 2012 11:03 AM by GaurangNaik
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,
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 ??
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.
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 ??
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
Aug 19, 2012 09:15 AM|LINK
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.
Hope this helps.
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..
Aug 19, 2012 09:22 AM|LINK
Please go through the second link which has code as well explaination of the code.
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 ??
Aug 19, 2012 09:28 AM|LINK
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.
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! "
can u elaborate where to save this code ?? the code to write data to table..