Showing posts with label statement. Show all posts
Showing posts with label statement. Show all posts

Sunday, March 11, 2012

Cannot load the DLL xpweb70.dll


Hi all
Have you ever used [Web assistant Wizard] in Sql server to create a web page from a predefined [Select] statement or Stored procedure??
when i want to do so and when i complete the Wizard i encounter with the following Error message :

--------
Microsoft SQL-DMO (ODBC SQLState: 42000)
--------
Error 22272: Cannot load the DLL xpweb70.dll, or one of the DLLs it references. Reason: 126(error not found).
--------
OK
--------

Could anyone help me please?
Kind Regards.

Hi ZarrinPour,

I suppose you are using sql2000. Some other users have also encountered this problem and raised it up. Solution is try to install the lasted service package. More informaton you can refer to

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=336312&SiteID=1

orhttp://www.devnewsgroups.net/group/microsoft.public.sqlserver.xml/topic5089.aspx

thanks

This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Sunday, February 19, 2012

Cannot INSERT data to 3 tables linked with relationship (INSERT statement conflicted with

Hello

I have a problem with setting relations properly when inserting data using adonet. Already have searched for a solutions, still not finding a mistake...

Here's the sql management studio diagram :

and here goes the code

1DataSet ds =new DataSet();23SqlDataAdapter myCommand1 =new SqlDataAdapter("select * from SurveyTemplate", myConnection);4SqlCommandBuilder cb =new SqlCommandBuilder(myCommand1);5myCommand1.FillSchema(ds, SchemaType.Source);6DataTable pTable = ds.Tables["Table"];7pTable.TableName ="SurveyTemplate";8myCommand1.InsertCommand = cb.GetInsertCommand();9myCommand1.InsertCommand.Connection = myConnection;1011SqlDataAdapter myCommand2 =new SqlDataAdapter("select * from Question", myConnection);12cb =new SqlCommandBuilder(myCommand2);13myCommand2.FillSchema(ds, SchemaType.Source);14pTable = ds.Tables["Table"];15pTable.TableName ="Question";16myCommand2.InsertCommand = cb.GetInsertCommand();17myCommand2.InsertCommand.Connection = myConnection;1819SqlDataAdapter myCommand3 =new SqlDataAdapter("select * from Possible_Answer", myConnection);20cb =new SqlCommandBuilder(myCommand3);21myCommand3.FillSchema(ds, SchemaType.Source);22pTable = ds.Tables["Table"];23pTable.TableName ="Possible_Answer";24myCommand3.InsertCommand = cb.GetInsertCommand();25myCommand3.InsertCommand.Connection = myConnection;2627ds.Relations.Add(new DataRelation("FK_Question_SurveyTemplate", ds.Tables["SurveyTemplate"].Columns["id"], ds.Tables["Question"].Columns["surveyTemplateID"]));28ds.Relations.Add(new DataRelation("FK_Possible_Answer_Question", ds.Tables["Question"].Columns["id"], ds.Tables["Possible_Answer"].Columns["questionID"]));2930DataRow dr = ds.Tables["SurveyTemplate"].NewRow();31dr["name"] = o[0];32dr["description"] = o[1];33dr["active"] = 1;34ds.Tables["SurveyTemplate"].Rows.Add(dr);3536DataRow dr1 = ds.Tables["Question"].NewRow();37dr1["questionIndex"] = 1;38dr1["questionContent"] ="q1";39dr1.SetParentRow(dr);40ds.Tables["Question"].Rows.Add(dr1);4142DataRow dr2 = ds.Tables["Possible_Answer"].NewRow();43dr2["answerIndex"] = 1;44dr2["answerContent"] ="a11";45dr2.SetParentRow(dr1);46ds.Tables["Possible_Answer"].Rows.Add(dr2);4748dr1 = ds.Tables["Question"].NewRow();49dr1["questionIndex"] = 2;50dr1["questionContent"] ="q2";51dr1.SetParentRow(dr);52ds.Tables["Question"].Rows.Add(dr1);5354dr2 = ds.Tables["Possible_Answer"].NewRow();55dr2["answerIndex"] = 1;56dr2["answerContent"] ="a21";57dr2.SetParentRow(dr1);58ds.Tables["Possible_Answer"].Rows.Add(dr2);5960dr2 = ds.Tables["Possible_Answer"].NewRow();61dr2["answerIndex"] = 2;62dr2["answerContent"] ="a22";63dr2.SetParentRow(dr1);64ds.Tables["Possible_Answer"].Rows.Add(dr2);6566myCommand1.Update(ds,"SurveyTemplate");67myCommand2.Update(ds,"Question");68myCommand3.Update(ds,"Possible_Answer");69ds.AcceptChanges();70

and that causes (at line 67):

"The INSERT statement conflicted with the FOREIGN KEY constraint\"FK_Question_SurveyTemplate\". The conflict occurred in database \"ankietyzacja\", table \"dbo.SurveyTemplate\", column 'id'.The statement has been terminated. at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)at AnkietyzacjaWebService.Service1.createSurveyTemplate(Object[] o) in J:\\PL\\PAI\\AnkietyzacjaWebService\\AnkietyzacjaWebServicece\\Service1.asmx.cs:line 397"

Could You please tell me what am I missing here ?

Thanks a lot.

The insert into Possible_Answer does not set questionId. The insert into question does not set surveyTemplateId.

It is better to do this with stored procedures, you can then see more clearly what values need to be supplied.

|||

I thought SetParentRow method cares for retrieving IDs and putting them into children rows...

Can't that be done form within these code or stored procedures are the only way I can do that ?

thanks

|||

You will need to read up on SetParentRow - a brief look on the MSDN site indicates that it only sets a relationship between objects, not copy the data value.

You do not have use stored procedures, they are just more effeicient and I respectfully submit easier to understand what data is required.

|||

TATWORTH, thank You for the advice concerning stored procedures.

Just done it and work fineSmile

For Those that might read this post in the future here's a nice tutorial on how to user stored procedure with realationships:

http://www.codeproject.com/cs/database/relationaladonet.asp?df=100&forumid=14883&exp=0&select=1214027

Thanks again.

|||

TATWORTH, thank You for the advice concerning stored procedures.

Just done it and works fineSmile

For Those that might read this post in the future here's a nice tutorial on how to user stored procedure with realationships:

http://www.codeproject.com/cs/database/relationaladonet.asp?df=100&forumid=14883&exp=0&select=1214027

Thanks again.