AddStoredProc() публичный Метод

Add procedure to execute
public AddStoredProc ( string spName ) : int
spName string procedure name
Результат int
Пример #1
0
        private static XdsRequestDocument GetRequestDocument()
        {
            var requestDocument = new XdsRequestDocument();

            requestDocument.Transaction = true;
            int reqId = requestDocument.AddStoredProc("SP_NAME", XmlDataResponseKind.DataSet);

            Assert.AreEqual(0, reqId);

            var request = requestDocument[reqId];

            request.AddParamArray("ID", "NAME");
            request.AddValue(1, "배성혁");
            request.AddValue(2, "sunghyouk");

            Assert.AreEqual(2, request.Values.Count);

            reqId = requestDocument.AddQuery("QUERY_NAME", XmlDataResponseKind.Scalar);
            var request2 = requestDocument[reqId];

            request2.AddParamArray("NAME");
            request2.AddValue("배성혁");
            request2.AddValue("sunghyouk bae");

            Assert.AreEqual(2, request2.Values.Count);

            request2.PreQueries.AddQuery("DELETE Employees where LastName='Bae'");
            request2.PostQueries.AddQuery("DELETE Employees where LastName='Bae'");

            Assert.AreEqual(1, request2.PreQueries.Count);
            Assert.AreEqual(1, request2.PostQueries.Count);

            return(requestDocument);
        }
Пример #2
0
        private static XdsRequestDocument GetRequestDocument() {
            var requestDocument = new XdsRequestDocument();
            requestDocument.Transaction = true;
            int reqId = requestDocument.AddStoredProc("SP_NAME", XmlDataResponseKind.DataSet);

            Assert.AreEqual(0, reqId);

            var request = requestDocument[reqId];
            request.AddParamArray("ID", "NAME");
            request.AddValue(1, "배성혁");
            request.AddValue(2, "sunghyouk");

            Assert.AreEqual(2, request.Values.Count);

            reqId = requestDocument.AddQuery("QUERY_NAME", XmlDataResponseKind.Scalar);
            var request2 = requestDocument[reqId];
            request2.AddParamArray("NAME");
            request2.AddValue("배성혁");
            request2.AddValue("sunghyouk bae");

            Assert.AreEqual(2, request2.Values.Count);

            request2.PreQueries.AddQuery("DELETE Employees where LastName='Bae'");
            request2.PostQueries.AddQuery("DELETE Employees where LastName='Bae'");

            Assert.AreEqual(1, request2.PreQueries.Count);
            Assert.AreEqual(1, request2.PostQueries.Count);

            return requestDocument;
        }