سؤال

I am getting this error while saving my data into the table. I have already created a 'product_Design' table in my database. I am using Sql Server 2008. Everything is working fine on local host but not on the server. I also tried to insert data in different tables and its working but I am just not able to insert data in this(product_Design) table ? I really need help regarding this thing.

here is my sql query

insert into z3ctjholo.dbo.product_Design values(@prodID, @productName, @designName, @designPath, @finalDesign, @front, @cont, @divHeight, GETDATE(), 0, 1)

I also tried this query

insert into product_Design values(@prodID, @productName, @designName, @designPath, @finalDesign, @front, @cont, @divHeight, GETDATE(), 0, 1)

Both the queries are generating error. Please help me out.

Thanks..

هل كانت مفيدة؟

المحلول

So finally i found what is the problem. if you ever face such kind of problem then execute this command in sql server and see whether your table is connected to any schema apart from dbo. Use this statement to check whether the table is connected to any other schema.

use yourDatabaseName

Then

SELECT * FROM INFORMATION_SCHEMA.TABLES

after that if you find that your table is connected with other schema apart from dbo then use your any statement like this

select * from schemaName.tableName 

(eg. my schema name is z3ctjholo and my table name is product_Design)

so my statement would be like this

select * from z3ctjholo.product_Design

what i was doing wrong, i was using two schema names (z3ctjholo.dbo.product_Design).

I hope it will help someone..

Thanks...

نصائح أخرى

There are two reasons, I can find so far. 1. Either the connection settings in web.config is incorrect. 2. your database is case sensitive collation and so check the name with case. May be you have created the table with name Product_Design and trying to insert in product_Design, in this case also, the command may not work.

Please check both the points.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top