Deriving parameters using Oracle.DataAccess.Client (ODP.NET)


, In an effort to resolve my other posted issue, I started porting the DAAB to use ODP.NET instead of System.Data.OracleClient. I am wondering if there is any way with Oracle.DataAccess.Client to achieve the System.Data.OracleClient.OracleCommandBuilder.DeriveParameters() functionality of deriving all the parameters in a stored procedure command
Posted On: Wednesday 7th of November 2012 09:19:16 PM Total Views:  358
View Complete with Replies

RELATED TOPICS OF Oracle PROGRAMMING LANGUAGE




SQLBindParameter not used for all parameters

I get the exception SQLBindParameter not used for all parameters when I view my code in the browser. I did a search on this exception and the website that I came across said that this exception will be thrown if the number of "" marks in your SQL insert statement does not match the number of fields that you list in the same insert statement when using OdbcConnection. I've checked if this is the case and it's not so now I don't know what to do. If you have any ideas as to what the problem might be, please help point it out. The following is my code to help you better understand my situation. VS2003 says that the problem is on the line "Dim result1 As Integer = myCommand1.ExecuteNonQuery( )". Thank you in advance for your help. Private Sub lblRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblRegister.Click \t\t\t Dim myConnection As OdbcConnection \t\t\t Dim myCommand As OdbcCommand \t\t\t Dim strInsert As String \t\t\t Dim strSQL As String \t\t\t strSQL = String.Empty \t\t\t myConnection = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDB;User=myUser; Password=myPass;Option=3;") \t\t\t strSQL = String.Format("SELECT UserName FROM myTable WHERE (UserName='{0}');", txtUserName.Text) \t\t\t myCommand = New OdbcCommand(strSQL, myConnection) \t\t\t myCommand.CommandType = CommandType.Text \t\t\t myConnection.Open() \t\t\t Dim result As Integer = myCommand.ExecuteNonQuery() \t\t\t If result > 0 Then \t\t\t\t\t lblMessage.Text = "That user name is already taken!" \t\t\t\t\t lblMessage.Text &= " Please choose another user name." \t\t\t Else \t\t\t\t\t strInsert = "INSERT into myTable (FirstName,LastName,Password,UserName)values (,,,)"\t\t\t Dim myCommand1 As OdbcCommand = New OdbcCommand(strInsert, myConnection) \t\t\t\t\t myCommand1.CommandType = CommandType.Text \t\t\t\t myCommand1.Parameters.Add("@FirstName", txtFirst.Text) \t\t\t\t\t myCommand1.Parameters.Add("@LastName", txtLast.Text) \t\t\t\t myCommand1.Parameters.Add("@Password", txtPassword.Text) \t\t\t\t myCommand1.Parameters.Add("@UserName", txtUserName.Text)\t\t\t\t\t \t\t\t Dim result1 As Integer = myCommand1.ExecuteNonQuery() \t\t\t\t\t myConnection.Close() \t\t\t End If \t End Sub
VIEWS ON THIS POST

254

Posted on:

Wednesday 7th November 2012
View Replies!

iDB2Command parameters

Hi all, \t I am trying to write an asp.net using vb and am having a problem adding a paramater. With the sqlcommand there is a method called AddWithValue this is not an option for iDB2Command. Without this option I have been unable to figure out how to add a parameter to the sql statement. I keep getting an error "ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'GetData' that has parameters: clsstring" The aspx file is called GetData2.aspx. The vb code in the App_Code folder is called UpdateRecords.vb. The class is called UpdateRecords. The function is called GetData. Any help would be appreciated.
VIEWS ON THIS POST

363

Posted on:

Wednesday 7th November 2012
View Replies!

How to call DB2 storedprocdeure from asp.net code with INOUT parameters

Pls help... I have to call a DB2 stored procedure from ASP.NET code by using 18 INOUT parameters. THis is aprocedure which gives me price for a particular product. Here is my code. Dim objconn As New OdbcConnection("DSN=ABCD;uid=xyz;password=123;") Dim objcmd As OdbcCommand Dim query As String Dim dblprice As Double Dim objParam As OdbcParameter Try objcmd = New OdbcCommand("CALL PKLIB.PKWEBPRC(,,,,,,,,,,,,,,,,,)", objconn) objcmd.CommandType = CommandType.StoredProcedure objcmd.Parameters.Add(New OdbcParameter("@PDIV", OdbcType.VarChar)).Value = "090" objcmd.Parameters.Add(New OdbcParameter("@PCOL", OdbcType.VarChar)).Value = "352" objcmd.Parameters.Add(New OdbcParameter("@PPATT", OdbcType.VarChar)).Value = "P000003" objcmd.Parameters.Add(New OdbcParameter("@PCOLR", OdbcType.VarChar)).Value = "N024" objcmd.Parameters.Add(New OdbcParameter("@PORDDT", OdbcType.Decimal)).Value = 80610 objcmd.Parameters.Add(New OdbcParameter("@PCUST#", OdbcType.VarChar)).Value = "00000000" objcmd.Parameters.Add(New OdbcParameter("@PCTYPE", OdbcType.VarChar)).Value = "090" objcmd.Parameters.Add(New OdbcParameter("@PQORD", OdbcType.Decimal)).Value = 1.0 objcmd.Parameters.Add(New OdbcParameter("@PRHSIN", OdbcType.VarChar)).Value = "F" objcmd.Parameters.Add(New OdbcParameter("@PQUAL", OdbcType.VarChar)).Value = "1" objcmd.Parameters.Add(New OdbcParameter("@LSTRCD", OdbcType.VarChar)).Value = "" objcmd.Parameters.Add(New OdbcParameter("@PPRCTP", OdbcType.VarChar)).Value = "" objcmd.Parameters.Add(New OdbcParameter("@PPRICE", OdbcType.Decimal)).Value = 0.0 objcmd.Parameters.Add(New OdbcParameter("@PPRLOD", OdbcType.Decimal)).Value = 0.0 objcmd.Parameters.Add(New OdbcParameter("@PRCSEQ", OdbcType.Decimal)).Value = 0 objcmd.Parameters.Add(New OdbcParameter("@EDTUPD", OdbcType.VarChar)).Value = "0" objcmd.Parameters.Add(New OdbcParameter("@PRCOM$", OdbcType.Decimal)).Value = 0.0 objcmd.Parameters.Add(New OdbcParameter("@PCURCY", OdbcType.VarChar)).Value = "USD" objconn.Open() objcmd.ExecuteNonQuery() dblprice = Convert.ToDouble(objcmd.Parameters.Item("@PPRICE").Value) Catch ex As Exception Response.Write(ex.Message) Finally objconn.Close() End Try Thispiece of code runs without any error butalways gives me price as 0. The variable @PPRICE will get the price of the product. Pls let me know whts wrong with my code.
VIEWS ON THIS POST

230

Posted on:

Wednesday 7th November 2012
View Replies!

Problem passing SQL parameters

I'm having a problem getting ASP.NET to pass parameters to MySQL through ODBC. I connected to my database just fine and can select, insert, update hardcoded values to my heart's content. I set up a test form to try inserting with parameters. It consists of 2 Text Boxes, (Text1 and Text2), and a "Submit" button (Button1). Now, obviously the idea here is to enter text into text1 and text2 and call a ds.Insert() into the db when i hit submit. Relevant code is here: \t\t\t\t\t \t\t\t\t\t\t\t\t \t\t\t\t\t\t\t \t\t\t\t\t \t\t\t Whenver i hit the submit button, the ASP passes to mysql the insert command in its entiretly, without replacing the parameters with the specified ones in the parameter list. I have changed the Direction field to all its combinations, and messed around with nearly every other property of the SqlDataSource, but regardless of what I do, the statement is passed to MySQL without the parameters substituted. Does anyone have any suggestions\t
VIEWS ON THIS POST

207

Posted on:

Wednesday 7th November 2012
View Replies!

Odbcconnection using parameters

hi i am trying to connect to a mysql database using odbcconnection and also using parameters but it isnt adding the parameter into the sql sqlConnect.cs publicclasssqlConnect { publicsqlConnect() { //NullCatch } publicstaticOdbcConnectiondataCon() { stringConnectionString=ConfigurationManager.AppSettings["dataBaseCon"].ToString(); OdbcConnectiondatabaseConnect=newOdbcConnection(ConnectionString); returndatabaseConnect; } } \tthen this is the the code trying to use the odbccommand\t OdbcConnection loginCon = sqlConnect.dataCon(); loginCon.Open(); //Open Connection string sqlSyntax = "SELECT usr_guid, usr_pass ,usr_active FROM tbl_usr WHERE usr_name="; OdbcCommand loginCom = new OdbcCommand(sqlSyntax, loginCon); loginCom.Parameters.AddWithValue("", userName.Text); OdbcDataReader loginRead = loginCom.ExecuteReader(); string dataPass = string.Empty; //Password Store string userGuid = string.Empty; //UserGuid Store int active = 0; // 0 == inactive , 1 = active while (loginRead.Read()) { userGuid = loginRead["usr_Guid"].ToString(); //UserGuid dataPass = loginRead["usr_pass"].ToString(); //Password in Database active = Convert.ToInt32(loginRead["usr_active"].ToString()); //Active user } loginRead.Close(); //Close the Read loginCon.Close(); //Close the Connection if anyone knows whats wrong with it please let me know becuase i cant get this to work.
VIEWS ON THIS POST

235

Posted on:

Wednesday 7th November 2012
View Replies!

Wrong number of parameters for sybase

all, I am trying to connect to a sybase datase (5.5) version i think. Belowis the code and parameter list i am using to execute aSP \t\t\t Dim mycmd As New OdbcCommand("sp_drum_fact") \t\t\t mycmd.CommandType = CommandType.StoredProcedure \t\t\t mycmd.Parameters.Add("drumfact", OdbcType.Char).Value = "95.3" \t\t\t mycmd.Parameters(0).Direction = ParameterDirection.Input \t\t\t mycmd.Parameters.Add("eq", OdbcType.VarChar, 20).Direction = ParameterDirection.ReturnValue \t\t\t mycmd.Parameters.Add("descrip", OdbcType.VarChar, 20).Direction = ParameterDirection.ReturnValue \t\t\t mycmd.Parameters.Add("size", OdbcType.Real).Direction = ParameterDirection.ReturnValue I am connecting fine and the stored procedure has the 1 input parameter and then the 3 return values. The issue i am getting is a Wrong number of parameters problem. Can anyone help me out with this, is there something i am not aware of or possible tips you could give me on this situation.
VIEWS ON THIS POST

242

Posted on:

Wednesday 7th November 2012
View Replies!

Using OUTPUT parameters from PL/SQL in ASP.NET code

I would like to communicate both ways between my ASP.NET application and my Oracle database. This is to give important feedback from the database back into the webpages once a procedure has finished running. Currently my stored PL/SQL procedures are working fine with input only parameters coming from the webpages. However it would be very useful for me if I could use a returned output parameter from Oracle back in my ASP.NET application. I have tried to set up a simple test to do this but I am stuck and I was hoping somebody might be able to help. I know the example is overly simplified, and in this particular example I would be better off using an INSERT command in ASP.NET. This is just to highlight the method of receiving back a paramete so that I can get the mechanism working. The error message I am getting so far is: " Unable to cast object of type 'System.Data.OracleClient.OracleParameter' to type 'System.Data.SqlClient.SqlParameter' " pointing to line 21 of the VB.NET code. I am unsure whether I am doing something wrong in my PL/SQL, VB.NET or ASP.NET code sections. The VB.NET code is: ImportsSystem.Data ImportsSystem.Data.Common ImportsSystem.Data.SqlClient PartialClasstestoutput InheritsSystem.Web.UI.Page ProtectedSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.Click 'CallthePL/SQLproc SqlDataSource1.Select(DataSourceSelectArguments.Empty) EndSub ProtectedSubSqlDataSource1_Selected(ByValsenderAsObject,ByValeAsSystem.Web.UI.WebControls.SqlDataSourceStatusEventArgs)HandlesSqlDataSource1.Selected DimcmdAsIDbCommand cmd=e.Command DimparamAsSqlParameter ForEachparamIncmd.Parameters 'Extractthenameandvalueoftheparameter,storeinlabel Label2.Text=Label2.Text¶m.ParameterName&"-"¶m.Value.ToString() Next EndSub EndClass The ASP.NET code is: Untitled Page The PL/SQL code is: create or replace procedure TestParam (vInput in number, vOutput out number) is begin vOutput := vInput * 2; insert into testoutput (id, input_number, result_number) values(seq_testoutput_id.nextval, vInput, vOutput); end TestParam; \t
VIEWS ON THIS POST

311

Posted on:

Wednesday 7th November 2012
View Replies!

GotDotNet DAAB, MySQLConnector, and parameters

Has anyone used the DAAB on GotDotNet (with the mysql.cs and adohelper.cs files) and does anyone have any examples of how to use any of the adohelper methods for multiple parameters Any examples in VB I've been trying all kinds of stuff to get it working with parameters and I'm getting nowhere.
VIEWS ON THIS POST

206

Posted on:

Wednesday 7th November 2012
View Replies!

Using multiple parameters

I get the following error when using more than one parameter: No error information available: DB_E_BADORDINAL(0x80040E55) My sp looks like this: procedure spSelect_met_SpatialDomain(prm_ProjectionID in number,prm_TypeID in number,pCursor out refResults) is sSQL varchar2(1000); begin sSQL := 'SELECT pklSpatialDomainID,fWestBC,fEastBC,fNorthBC,fSouthBC FROM MET_SpatialDomain where fklPROJECTIONID = '|| prm_ProjectionID ||' AND fklTYPEID = '||prm_TypeID; Open pCursor for sSQL; end Spselect_Met_Spatialdomain; And the code which calls the sp is as follows: DataTable dt = new DataTable(); dt.Columns.Add("sFileName"); dt.Columns.Add("sShareName"); dt.Columns.Add("sPath"); dt.Columns.Add("pklNativeID"); OleDbConnection oConn = new OleDbConnection("Provider=MSDAORA.1;Data Source=TEST;User ID=metadata;Password=metadata;"); oConn.Open(); OleDbCommand oCmd = new OleDbCommand("{call metadatarelease.spSelect_metadata_Native(,{Resultset 0, pCursor})}", oConn); oCmd.Parameters.Add("prm_TypeID",OleDbType.Numeric,4,"fklTypeID").Value = cboExtension.SelectedValue; oCmd.Parameters.Add("prm_HostID",OleDbType.Numeric,4,"fklHostID").Value = cboName.SelectedValue; OleDbDataReader oDr = oCmd.ExecuteReader(); while(oDr.Read()) { string sID = oDr.GetValue(0).ToString(); string sFile = oDr.GetValue(1).ToString(); string sShare = oDr.GetValue(2).ToString(); string sPath = oDr.GetValue(3).ToString(); dt.Rows.Add(new String[]{sFile, sShare, sPath, sID}); } //close connection and reader oDr.Close(); oConn.Close(); DataGrid1.DataSource = dt; DataGrid1.DataBind(); THANKS IN ADVANCE
VIEWS ON THIS POST

349

Posted on:

Wednesday 7th November 2012
View Replies!

connect to mysql or sqlserver with a class which has parameters for both

i have a aplication which need to connect to 2 database (one on mysql and other on sql server) , and i decide to make a class in a dll which will have some parameters to the constructor , from which will depend the type of connection... have anyone of you something like that\t......have ideas how to succed with this..... you think that i could or not to finish this... help me. thx a lot
VIEWS ON THIS POST

303

Posted on:

Wednesday 7th November 2012
View Replies!

Trying to bind to datagrid using mysql parameters

I'm trying to connect to my db using parameters (partly to get around injection attacks). However, for some reason my code is not working. Any help would be appreciated as the code was working previously when included as a dynamic string. Basics of the code I am using is: strSQL = "SELECT * FROM coins" & " Where Cat1 = 'fc' And Cat3 = 'fs' ORDER BY Id DESC Limit 5;" cmd = New MySqlCommand(strSQL, myConnection) Dim sqlPar1 = New MySqlParameter("fc", MySqlDbType.String) cmd.Parameters.Add(sqlPar1) cmd.Parameters("fc").Value = "Coins" Dim sqlPar2 = New MySqlParameter("fs", MySqlDbType.String) cmd.Parameters.Add(sqlPar2) cmd.Parameters("fs").Value = "Silver" myConnection.Open() Dim datar As MySqlDataReader datar = cmd.ExecuteReader() GridView2.DataSource = datar GridView2.DataBind() datar.Close() myConnection.Close() Any obvious problems that you can see with the code
VIEWS ON THIS POST

311

Posted on:

Wednesday 7th November 2012
View Replies!

insert with parameters doesn't work

I'm performing an onsert instruction with oledb class. Thi is the code ConnDB.Connessione myConnection = new ConnDB.Connessione(); myConnection.AperturaConnessione(); String insertCmd = "insert into TABLE(F1,F2,F3) " + \t\t\t\t\t\t" values " + \t\t\t\t\t\t"(@f1, @f2, @f3)"; OleDbCommand myCommand = new OleDbCommand(insertCmd, myConnection.Conn); myCommand.Parameters.Add(new OleDbParameter("@f1", OleDbType.Integer, 4)); myCommand.Parameters["@f1"].Value = Convert.ToInt32(Session["ditta"].ToString()); myCommand.Parameters.Add(new OleDbParameter("@f2", OleDbType.Integer, 3)); myCommand.Parameters["@f2"].Value = Convert.ToInt32(txtCodice.Text); myCommand.Parameters.Add(new OleDbParameter("@f3", OleDbType.Char, 60)); myCommand.Parameters["@f3"].Value = txtCodice.Text; try { myCommand.ExecuteNonQuery(); } The procedure returns this error message: System.Data.OleDb.OleDbException: ORA-00936: missing expression at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForMultpleResults(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at Elezioni.SeleVotazione.btnInserisciVotaz_Click(Object sender, EventArgs e) in f:\inetpub\wwwroot\elezioni\selevotazione.aspx.cs:line 98 I don't understand what i wrong!!!!!! Plese help me!!!
VIEWS ON THIS POST

150

Posted on:

Wednesday 7th November 2012
View Replies!

How to pass in parameters using oracle data provider

Hi all i am trying to retrieve some data from a table but i was unabl to pass in an input parameters. below are my codes: Public Function GetWFProceses(ByVal workflowNo As String) As Boolean Try ' Represents SQL command for execution, to return results Dim comm As New OracleCommand("", ConnectionDB.conn) comm.CommandText = "Select Process.ProcessDesc, ACT_START, ACT_END, SCH_START, SCH_END, Status from PROCESSLOG, Process where PROCESSLOG.processID=PROCESS.processID AND ProcessLog.workflowID = :wfid" Dim param As New OracleParameter("wfid", OracleDbType.Varchar2) param.Direction = ParameterDirection.Input param.Size = 10 param.Value = workflowNo comm.Parameters.Add(param) ' Represents XML operations on OracleCommand. Setting ' OracleXmlCommandType.Query returns result as XML document comm.XmlCommandType = OracleXmlCommandType.Query ' XmlReader provides read-only fast access to XML data, ' OracleCommand.ExecuteXMLReader returns an XML document as result Dim reader As XmlReader = comm.ExecuteXmlReader() ' .NET framework class representing XmlDocument Dim doc As XmlDocument = New XmlDocument ' Handles white spaces during XmlDocument load process doc.PreserveWhitespace = True ' Loads data from the specified XmlReader doc.Load(reader) ' Gets markup representing root node and all its children Dim str As String = doc.OuterXml Dim mywriter As New StreamWriter("d:\temp\processLog.xml") mywriter.Write(str) mywriter.Close() comm.Dispose() Return True Catch ex As Exception Throw New Exception(ex.Message) Return False End Try This is the part of my codes i am not too sure what have gone wrong.. this is the error message i get: Operation is not valid due to the current state of the object. Can anyone help me with it thanx : )
VIEWS ON THIS POST

258

Posted on:

Wednesday 7th November 2012
View Replies!

Oracle parameters

to all, Im using VS.NET 2003, I got a data adapter named byDateRange now this data Adapter takes two input values in date format i.e. fromDate and toDate. Now I have a web service call that calls the data adapter and passes the fromDate and the toDate values. The data adapter is then to return me a dataset. The for the service call is as follows: PublicFunctionByDateRange(ByValfromDateAsDate,ByValtoDateAsDate)AsDataSet DimdsAsNewDataSet DimfDateAsDate=fromDate DimtDateAsDate=tDate IffromDate>toDateThen ExitFunction EndIf Me.daByDateRange.SelectCommand.Parameters.Add(":StartDate",fDate) Me.daByDateRange.SelectCommand.Parameters.Add(":StopDate",tDate) dbConn.Open() Me.daByDateRange.Fill(ds,"ByDateRange") dbConn.Close() Returnds EndFunction Now when I execute the web service call on the browser I get the following error message. System.Data.Odbc.OdbcException: ERROR [07S01] [Oracle][ODBC]Invalid use of default parameter. at System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle, SQL_HANDLE hType, RETCODE retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method) at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Odbc.OdbcCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at ReportingWS.DataService.ByDateRange(DateTime fromDate, DateTime toDate) in c:\inetpub\wwwroot\ReportingWS\DataService.asmx.vb:line 86 I have review many posting and re-searched this problem for quite sometime now and still am unable to figure it out. anyone out there got any suggestions.
VIEWS ON THIS POST

384

Posted on:

Wednesday 7th November 2012
View Replies!

Do command parameters stop SQL injection attacks?

I have noticed that if you use ado.net command parameters, you don't have to fix up quotes before adding them to a SQL string. ( You don't need to make a single quote a double quote. ) Please correct me if I'm wrong, but does this mean that SQL injection attacks are completely avoided
VIEWS ON THIS POST

178

Posted on:

Wednesday 7th November 2012
View Replies!

passing parameters

The following code gives error: "System.Data.OracleClient.OracleException: ORA-01036: illegal variable name/number". \t\t\t\t\t \t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t \t\t\t\t\t I tried to replace the colon with @ but still got the same error. What is wrong here
VIEWS ON THIS POST

241

Posted on:

Wednesday 7th November 2012
View Replies!

No value given for one or more required parameters.

, I am getting the "No value given for one or more required parameters."when importing an Excel 2003 spreadsheet into my web site. I have pinpointed the problem to be the last column in my SELECT statement. This column does not seem to be a reserved word and the the data in the column 'POS' and 'HMO' seems fine as well. The SELECT code is posted below as well as 4 other columns I am having the same problem (they are commented out for now). Any help solving this problem would be greatly appreciated. DimobjCommandAsNewOleDbCommand("SELECT[EmployeeName]asEmployee, "&_ "[ResidenceZipCode]asZipCode,"&_ "[Position]asEmpPos,"&_ "[FTExempt,FTNonExempt,PTExempt,PTNonExempt]asExempt,"&_ "[AnnualSalaryORHourlyRate]asRate,"&_ "[HoursPerPayCycle]asHoursPerPayCycle,"&_ "[DateofBirth]asDateOfBirth,"&_ "[Gender]asGender,"&_ "[Status:ActiveorCOBRA]asAorCStatus,"&_ "[PlanName]asPlnName"&_ "FROM[Census$]",objXConn) '"[WorkersCompCategory]asWorkersComp,"&_ '"[MedicalTier:EEOnly,EE&Child(ren),EE&Spouse,Family,Waived,NotEligible]asMedicalTier"&_ '"[#ofChildren]asNrChildren,"&_ '"[DentalTier:EEOnly,EE&Child(ren),EE&Spouse,Family,Waived,NotEligible]asDentalTier"&_
VIEWS ON THIS POST

288

Posted on:

Wednesday 7th November 2012
View Replies!

Calling a stored proc on an AS/400 with IN and OUT parameters failing


VIEWS ON THIS POST

139

Posted on:

Wednesday 7th November 2012
View Replies!

Can I use a ControlParameter for a stored procedure's parameters? (SqlDataSource,Oracle)

I have anaspx page which isa survey. The user fills in various values, and then thosevalues are to be saved as the survey resultson the Oracle DB. The examples below are not the survey itself, but they're similar to what I would betrying to do. The goal is to avoid explicitly writing all that code for creating a connection, a command, and then adding the parameters one by one. (Several of these surveys have many, many input survey values; one even has over 100 input parameters, and I was hoping that "declarative" code would be an improvement over procedural code). Is it possible to connect visual controls which are within the ItemTemplate of a FormView with within of a SqlDataSource\t I've been trying different things in the ControlParameter's ControlID attribute; I'm getting error messages such as "Could not find control 'TextBox1' in ControlParameter 'TESTNUM'."and Could not find control 'Form1.TextBox1' in ControlParameter 'TESTNUM' and Could not find control 'Form1$TextBox1' in ControlParameter 'TESTNUM' and Could not find control 'Form1%TextBox1' in ControlParameter 'TESTNUM' Here's what's in my Oracle package: createorreplacepackageLAMTESTPKG_3IS PROCEDURELAMTEST_INPUTS(testnuminnumber,num2innumber,msginvarchar2); ENDLAMTESTPKG_3; Here's the FormView visual control on ASPX page: 18 100 World! The names of the three visual controls are TextBox1, TextBox2, and TextBox3.I've initialized their Text properties using the Properties window while in Design mode. (namely, 18, 100, " World!")Here's what's in the SqlDataSource: \tHere's the full error message: Server Error in '/Test_StoredProces' Application. Could not find control 'TextBox1' in ControlParameter 'TESTNUM'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Could not find control 'TextBox1' in ControlParameter 'TESTNUM'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Could not find control 'TextBox1' in ControlParameter 'TESTNUM'.] System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +1725436 System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +46 System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +103 System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +40 System.Web.UI.Page.OnLoadComplete(EventArgs e) +2063076 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1875 Version Information:Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 \t
VIEWS ON THIS POST

263

Posted on:

Wednesday 7th November 2012
View Replies!

CLOB Size when specifying parameters

! I wonder if someone could help me with their expertise. I have writen a data services class which is responsible for extracting OUT parameters from my Oracle stored procedures in CLOB format. I am using the MS Oracle Client as dealing with CLOB suits me as it conicides with my workflow message formats. However, my question is, what is the maximum output value for a CLOB size when building parameters If I exclude it it fails saying it needs to be specified How do I specify this THe actualy error I get is saying I have a character overflow for my (very small) xml string, this is because just to keep .net happy I set an arbitary value of 4000 (which I assume means 4000 characters which I have exceeded). Incidently I increased this to 10000 and the procedure brings back nothing but nulls !!!!! I am very confused ! Perhaps someone could benefit me with their expereince !!!
VIEWS ON THIS POST

299

Posted on:

Wednesday 7th November 2012
View Replies!