c# - Why am I getting, "Problemo Loading The designer encountered an error while loading the table definition." when trying to add a Local table? -


in visual studio community winforms app, added local (*.mdf) database. server explorer, right click tables folder , select "add new table"

on design page get, "problem loading designer encountered error while loading table definition."

i can add ddl in t-sql pane directly:

create table [dbo].[table] (     [id] int not null primary key     [weekofassignment] datetime not null     [talktype] int not null     [studentid_fk] int not null foreign key     [assistantid_fk] int not null foreign key     [counselpoint] int not null ) 

...but don't see "execute" button. how can create table i've got defined?

btw: put "problemo" in title, because "problem" not allowed; and, after a, ("problem") is direct quote of err msg.

update

i'm thinking maybe need create table programmatically:

string dbname = "ayttfmdatamdf"; using (var connection = new system.data.sqlclient.sqlconnection(     "data source=[my conn string here])) {     connection.open();     using (var command = connection.createcommand())     {     command.commandtext =           "create table [dbo].[assignmenthistory] ( [id] int not null primary key     [weekofassignment] datetime not null     [talktype] int not null     [studentid_fk] int not null foreign key     [assistantid_fk] int not null foreign key     [counselpoint] int not null)"      command.executenonquery(); 

thoughts?


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -