- Has To Enter The Table Name
- Then Add Asmany Column Names and their datatypes
When they have entreered all the column details they are prompted to add a primary keys and Froegen Keys.
Im having trouble on the Adding primary keys, This what i have done so far:
The user inouts the primary keys and they are seperated using commas.
In the code area i have:
>Getting The Values From The User
>Entering The Values To A string Varaible Called pKeys. using readline()
Now seperating the values from the commas to get the entered numbers
IList<string> primaryKeyValues = pKeys.Split(new string[] { ",", " " },
StringSplitOptions.RemoveEmptyEntries);
Then i convert the strings into Integer values so i can use these as index accessors to the array i have holding the tableColum details
int[] primaryKeyIntValues = new int[primaryKeyValues.Count];
int counter = 0;
foreach (string s in primaryKeyValues)
{
primaryKeyIntValues[counter++] = int.Parse(s);
}
I have a database connection program implemented which has a update method and this is the parameter i pass on:
DatbaseConn.Update("CREATE TABLE " + tableName + "(" + tableColumnsJoined + ", PRIMARY KEY(" ")");
Im not shure how can i access the colums to craete a primary keys in this sentence of code abovce.
Would anyone have any advice.
Thanks

New Topic/Question
Reply



MultiQuote




|