Thursday, March 29, 2012

Configure data source insertion into SQL Server 2005 database - Express editions

I am attempting to insert information from Visual Web Developer 2005 using either the Gridview or Datalist controls into a SQL Server 2005 database and get stuck when defining the custom statement.

When I enter the text within the insert tab, the <next> button remains greyed out, preventing me from continuing to the next page.

If I copy the same text into the select tab, then I can continue with the wizard, however this raises other problems which may or may not be related (multiple insertions of the data into the SQL Server database table - possibly due to postback functions). I would rather use insert to confirm that my second problem is not because I am using the wrong option.

My question is:

Should I be able to use the insert function within VWD express or is this only available within the standard/pro editions?

Are you using SqlDataSource as the DataSource fo GridView/DataList? I tried that and I can edit customized INSERT command. Can you open QueryBuilder when you enter INSERT command?

|||

I am using SqlDataSource as the datasource as well as a valid connection string to my SQL Server Database.

I launched query builder to construct the sql command for insert. It brings up the appropriate table and columns and I have tried using both parameters and then free text responses with the same result.

If I copy the complete insert command (as constructed from query builder) and paste it into the select tab, then I am able to complete the wizard and my table is populated (albeit with multiple rows).

This implies that the sql statement is valid, however I would have thought that even a simple insert query - insert into table1 values("xxx") - would allow me to progress through the SqlDatasource wizard without any difficulty.

Sadly, I am unable to attach a screenshot which would make the visualisation of the problem that much easier.

To re-iterate my problem, I only get so far within the configure data source wizard - click a tab to create a SQL statement for that operation - <INSERT-TAB>, "sql_statement" before hitting a brick wall as both the next and finish buttons are greyed out.

I would appreciate any assistance you can provide on this matter.

Paul

No comments:

Post a Comment