I’d rather not require Carpal Tunnel therapy every time I change a column name. In my case, that was two more tables.Ĭrazy? Well, considering it would still be a lot of work if we didn’t have the DataSet Designer, not too crazy. If you want to keep things consistent, repeat all previous steps for every table that has a foreign key pointing to our modified column.With the tableadapter selected, in the properties window, hit the plus sign next to “UpdateCommand,” highlight the “CommandText” field, click the ellipses, and modify the statement to match the new column name.With the tableadapter selected, in the properties window, hit the plus sign next to “InsertCommand,” highlight the “CommandText” field, click the ellipses, and modify the statement to match the new column name.With the tableadapter selected, in the properties window, hit the plus sign next to “DeleteCommand,” highlight the “CommandText” field, click the ellipses, and modify the statement to match the new column name.With the tableadapter selected, in the properties window, hit the plus sign next to “UpdateCommand,” highlight the “Parameters” field, click the ellipses next to where it says “(Collection),” select the column name, then change the DbType, ColumnName, Size, SourceColumn, ParameterName, and ProviderType columns.With the tableadapter selected, in the properties window, hit the plus sign next to “InsertCommand,” highlight the “Parameters” field, click the ellipses next to where it says “(Collection),” select the column name, then change the DbType, ColumnName, Size, SourceColumn, ParameterName, and ProviderType columns.With the tableadapter selected, in the properties window, hit the plus sign next to “DeleteCommand,” highlight the “Parameters” field, click the ellipses next to where it says “(Collection),” select the column name, then change the DbType, ColumnName, Size, SourceColumn, ParameterName, and ProviderType columns.With the column name selected on the dataset, update the “MaxLength” property to match the new column datatype if needed.With the column name selected on the dataset, change the “DataType” property to match the new column name.With the column name selected on the dataset, change the “Source” property to match the new column name.With the column name selected on the dataset, change the “Name” property to match the new column name.Maybe there’s a better way, but just to change my one, single, measly column name and datatype, here’s what I had to do as far as the DataSet Designer goes (in other words, excluding code changes in other application layers as well as the initial change in the database) Today, for example, it turned out that I needed to modify the name and datatype of a column in one of my database tables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |