Click here to Skip to main content
15,844,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi my store procedure worked correctly when I run it into sql server but when I pass xml parameter from asp to sql, this error appear:

SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations

my store procedure:
SQL
alter proc test
@hed_fact xml
as
 select r.c.value('(person)[1]','varchar(6)')
 from @hed_fact.nodes('/row')r(c)


my c# code:
C#
string hed_xml = "<row><person>000590</person></row>";
        SqlConnection conn = new SqlConnection(connectionStr.conn("sg"));
        SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "test";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection = conn;
 
                cmd.Parameters.AddWithValue("@hed_fact", hed_xml);
                if(conn.State==ConnectionState.Closed)
                   conn.Open();
                string res = cmd.ExecuteScalar().ToString();
                conn.Close();
                cmd.Dispose();
                Button1.Text = res;
Posted

 
Share this answer
 
Comments
Abhinav S 16-Mar-14 2:50am    
Comment from OP - "thanks for this solution, but I have that error yet."
Thanks Abhinav. :)
programmer33 16-Mar-14 2:53am    
thanks a lot, solution's :
1.Go to the Server Properties.
2.Select the Connections tab.
3.Check if the ansi_padding option is unchecked.
Okay. Great. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900