I have been messing about with this for hours surely this should be an easy task ....... I have a stored procedured that creates a invoice on a Quotetable one of the parameters is a output parameter Invoice Number this is passed to a label. (Label1) This works great.
I then need to add items to the invoice on a item table so my next stored procedure should take the value of Label1 and update the foreign key quotenumber on the itemtable with the value from label1.
On the aspx page I have a small section for a gridview which shows the current quote with however many items on it using the control
[Code]....
On the ASP page the control for @Quotenumber = Label1 but I get the following error
'Conversion failed when converting the nvarchar value 'Label' to data type int.'
in asp.net i want the user to chose a photo to upload from their HD . then i want the uploaded photo displayed and an hyperlink option to save or reject this photo. if accepted the filename will be stored in a DB.
the problem is displaying the photo before it has been saved.
I display strFileName which works on my PC but not on my laptop.
I'm getting this message when going to a web app that accesses my service.
"The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8)..."
The thing is, it happens once in a while even when no changes have been made to the service or the web app. And I can make it go away most of the time by going directly to the .svc?wsdl page in my browser and then coming back to the web app.
Example: I create a custom type in my domain model (say a "Country" class with Id and Text fields)
A "Person" object have a property of the above type.
The Service class return a list of Countries (IEnumerable<Country> GetCountries();)
Now the ViewModel, derive from the "Person" object and have a member "Countries" which is IEnumerable<SelectListItem> Countries (It convert the Country collection from the service to a collection of SelectListItems.
I use the SelectLIst collection to populate my dropdown.
However when I submit the form, validation fail, obviously because the "Country" dropdown give a string value, while a Country object is expected.
So I need to cast this value from a string (using the "id" of the SelectListItem) to a Country object.
Where and how would be the right way to do this? (Another late night with me bing brain dead and probably overlooking the obvious).
So, I've been programming for a number of years. Finding some intricately asinine issues w/ ASP.NET and VB.NET as I learn them. How about this one:
[Code]....
The issue is not Date1 The issue is Date2.
No kidding. I had to String.Format Date1 for some odd reason, even though I'd already validated it. And, yes, I tried to parse and convert Date1 but I kept gettting the typical "Argument 'Date2' cannot be converted to type 'Date'." error. (Did you catch the copy & paste? I didn't edit it from my existing error, but Date2 should be Date1.) Yeah, that's the error I'm getting now with the above ...
"Argument 'Date2' cannot be converted to type 'Date'."
Date2 is a system defined type. Why can't the system convert and/or simply use it's own pre-defined type?
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<string>' to 'string' OK I am fairly new to LINQ, but I am starting to get the hang of it. So here is the of my code that bugs:
[Code]....
And it returns this error, on the second line for p:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<string>' to 'string'
Anybody know how to start trying to figure this error out? This is the only error I get when debugging the app. I get no errors during the compile phase. This is an ASP.NET 3.5 App. Breaking on my local machine and a server.
Line 149: public new ASP.masterpage_master Master { Line 150: get { Line 151: return ((ASP.masterpage_master)(base.Master)); Line 152: } Line 153: } Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files oote04eaf87eb3a5588App_Web_tmdefault.aspx.cdcab7d2.ytin7a8n.0.cs Line: 151
On the Server I get this error:
Parser Error, Description: An error occurred during the parsing of a resource required to service this request. review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'Default'.
Source Error:
Line 1: <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" Debug="true"%> Line 2: <%@ MasterType virtualPath="~/MasterPage.master"%> Line 3:
I am looking to convert a String (which contain my XML) to Clob type in VB.net 2005 and call a Oracle Store Procedure which return me XML in Clob type and need Convert it back to String.
Please consider below example for better reference..
Below Method Call the Oracle Procedure with String as Input
Private Function Pricing(ByVal sXML As String, ByVal strOutputXML As String, ByVal sStatus As String, ByVal sMsg As String)
Dim objParams(3) As OracleParameter objParams(0) = New OracleParameter("input_xml", OracleType.Clob, 100000) objParams(0).Direction = ParameterDirection.Input objParams(0).Value = myclob objParams(1) = New OracleParameter("output_xml", OracleType.Clob, 100000) objParams(1).Direction = ParameterDirection.Output objParams(2) = New OracleParameter("status", OracleType.VarChar, 100) objParams(2).Direction = ParameterDirection.Output objParams(3) = New OracleParameter("msg", OracleType.VarChar, 1000) objParams(3).Direction = ParameterDirection.Output ExecuteDataset(objOMARConnection, CommandType.StoredProcedure, "PRICING_INT.ITEM_PRICE", objParams)
End Function
ORACLE Procedure
PROCEDURE item_price ( input_xml IN CLOB, output_xml OUT CLOB, status OUT VARCHAR2, msg OUT VARCHAR2
I want to log all errors happened in my App to sql db. I'm passing all exception properties like (ex.Message, ex.Source, ex.StackTrace, ex.TargetSite and ex.InnerException) to stored procedure.
The problem is that when I try to pass the ex.InnerException as string to stored procedure I got this error:
Cannot implicitly convert type 'System.Exception' to 'string'
I tried ex.InnerException.ToString() and Convert.ToString (ex.InnerException) but no success.
I am trying to get text box values into a database from a asp.net form. In my SQL server database I have defined the field emailID as nvarchar(50) and I still get the error messageconversion failed when converting the varchar value abcd@efg.com to type int" I am not trying to convert it int so my guess is SQL server is doing some kind of implicit conversion.
I have been looking for a way to convert C# datatype into database specific type of MS SQL. For example when I do [Code]....
I would get System.GUID or something like that but what I want is UniqueIdentifier instead of System.GUID. In most cases, I would also want the length of the type like varchar(1000) and stuff like that. Is there anyway I could convert or get similiar result ?
The problem is the output is getting displayed as : 10/20/2010 1:36:01 PM
I know RegistrationDate is datetime stamp that's why i am getting output in this format.
But i want to display RegistrationDate as: Oct 20, 2010 at 1:36pm -> according to (GMT-05:00) Eastern Time (US & Canada) ORDER BY RegistrationDate in Desc (top most will be last registered user)