Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Error exists after modification in a database table.

$
0
0
<div class="quote"> <div class="quote_body">Hello Experts,</div> <div class="quote_body">Currently I'm working on 'Entity Framework Models' on my own ASP.NET project. I have completed my database design. During the 'Entity Framework Models' design phase I found that I made a mistake in my database design . In the 'ProductTypes' table I declare the 'Name' column as VARBINARY(50) datatype instead of VARCHAR(50). During the design of the 'ManageProductTypes.aspx' page I'm getting the following errer i.e.</div> </div>


private ProductType createProductType()
{
ProductType p = new ProductType();
p.Name = txtName.Text;
// Error: Can't implicitly convert type 'string' to 'Byte'

return p;
}


After that, to resolve the error I wrote the following SQL command in SQL Server 2008:

ALTER TABLE [dbo].[ProductTypes]
ALTER COLUMN Name varchar(50) NOT NULL;


Commands were executed successfully. But still I'm getting the same error on my 'ManageProductTypes.aspx' page.
Please help me regarding this matter.
Thank You in advance,


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>