Creating a new database...
-
Hi How we can create a new database for example access database that does not exist before by ADO.NET? the code must create files that needed for database (in this example .mdb file) and I want to know how create a new table in database and update database. Regards' Amir Jalaly
-
Hi How we can create a new database for example access database that does not exist before by ADO.NET? the code must create files that needed for database (in this example .mdb file) and I want to know how create a new table in database and update database. Regards' Amir Jalaly
The easiest way for Access is to simply copy an empty access database (or a "template" with your data structures but no data) using filecopy. ADO.Net doesn't support "create Database" for Acess (actually it is the underlying oledb provider that doesnt support this), and the ADOX "create catolog" stuff isn't there either. To create a new tqable, juse use and execute query (OledbCommand.Execute or OledbConnection.Execute) like "Create Table TableName (Field1 Int Null, field2 Varchar(255), field3 Double)" If you need spaces (or keywords) in table/field names, then enclose them in sqare brackets [Field and Space] int,... Genius may have its limitations, but stupidity is not thus handicapped. - Elbert Hubbard