|
I have following Enum.
Public Enum EmailSubject
<description("accepted")> Accepted
<description("denied")> Declined
<description("not approved")=""> NotApproved
<description("pending verification")=""> Audited
End Enum
How do I pull Description into string?
EmailSubject.Accepted.Description not working?
|
|
|
|
|
Do you mean you want the string value of your enum?
Calling tostring() on your enum should do it.
EmailSubject.Accepted.ToString()
that will give you the string "Accepted"
|
|
|
|
|
toString not working. not giving full description
|
|
|
|
|
What do you mean with full description?
|
|
|
|
|
There are some converters for that purpose. See e.g. Description Enum TypeConverter[^] here on CP. If you need localization, use ResourceManager and resource files instead.
|
|
|
|
|
Hi
I am sending mail from asp.net Code.
can i get recipient mail address after sending mail from email id by which i am sending mail?
|
|
|
|
|
Without receipent mail how can you send the mail ?
|
|
|
|
|
Hi All,
I have an asp.net application which is trying to consume a web service developped by using some language but from IBM environment. When I asked about wsdl location they gave me physical path rather than virtual path. If they would have given me the virtual path I could have used web references. But they have given only physical path. Which we can't access with web/service reference in our visual studio.
I have been given the WSDL file then I have we created proxy file using SOAPUI utility (SOAP-UI creates proxy for .net 2.o environment). Is it because of that or something else but I am getting exception when I trying to hit the service and get the data. It is giving me following exception.
The request failed with HTTP status 404: Not Found.
And in the stack trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at WA.LNI.StayatWork.Public.UI.RetroMembersV1WSDLService.RetroMembersV1WSDLSOAP_HTTP_Service.GetRetroMemberInfo(t_request request) in D:\source\SourceCode\StayatWork-VS2010\WA.LNI.StayatWork.Public.UI\RetroMembersV1WSDLSOAP_HTTP_Service.vb:line 48
at WA.LNI.StayatWork.Public.UI.WebServiceTestPage.Page_Load(Object sender, EventArgs e) in D:\source\SourceCode\StayatWork-VS2010\WA.LNI.StayatWork.Public.UI\WebServiceTestPage.aspx.vb:line 184
And one more thing to add now I found that my application call even not going to the proxy class. Because I put break points in my proxy class contructor and few other methods, my application is not even going to those break points whats this weird thing I dont know. Please anybody pls help me its little urgent.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 26-Sep-12 14:30pm.
|
|
|
|
|
Well that's an oxy-moron, asking for help accessing a web service, but you can't even get to the web service, so the web service has nothing to do with your problem, because your not even there yet.
So I'm looking at a stack trace for no reason here.
404 means the HTTP request could not be made, the rest of the trace says it sent the request, but no response was delivered. So the request went somewhere on port 80, or else it would of stalled for a very long time with a page not found error. if no port 80 was there, it would be an instant return.
http://en.wikipedia.org/wiki/HTTP_404[^]
in D:\source\SourceCode\StayatWork-VS2010\WA.LNI.StayatWork.Public.UI\RetroMembersV1WSDLSOAP_HTTP_Service.vb:line 48
The stack trace means nothing at this point,
Can't really help you here, you need to help yourself,
try elimination first, use a different url to test on, to see if you can get through the peoxy.
test the web service on your browser, with proxy on, to see if it comes up.
it might be something dumb, like a wrong value.
If you can't hit the breakpoint, set the point higher, and walk through it using F11, I know it painful to walk, but that's the only way your going to find it.
|
|
|
|
|
Hi,
I could able to hit the break point, I was not hitting break point becuase System.Diagnostics.DebuggerStepThroughAttribute() attribute was set on my class. But still I am getting the same exception.
And as you said its returning immediately.
I am not finding the reason please help me its an urgent.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
hello
urgently i am fresher plz............
my question is that how can see different different content in div on same page after click on menu.
example ---
we take a tab(service) on menu bar in dropdown form such as service----
|---security device
|--- event management
|--- property dealing
when i click on secutiy device then it only open the detail of secutiy detail on same page(service).similarly in case of event management, property dealing. on particular id.
|
|
|
|
|
Just read some tutorials about MVC. You obviously don't understand principles of this framework.
No more Mister Nice Guy... >: |
|
|
|
|
|
Hi!
I am mostly focused on DB and desktop development, all of my "good" web stuff was done with WebForms. As my spare time allows I am slowly learning ASP.Net MVC, I agree with philosophy behind it, but learning process is much slower than expected and from time to time I look across the fence for possible shortcuts, alternatives etc.
So, should Web Pages be considered as an alternative (of any sort) to ASP.Net MVC?
Do you consider it better than WebForms (and why)?
Are there any important gotchas which usually aren't listed among first N Google results?
Can someone share their experience?
Thanks,
Deka
|
|
|
|
|
I have worked on Webforms previously and now MVC. In my opinion MVC is better in performance, speed and flexible for test-driven development. Here is the interesting part.... No postbacks, No viewstates, No server controls, No page life-cycle. All done with HTTP RESTful services and HTML controls. And it's completely stateless. Controller controls all user interactions. each user request is served by raising an action method in the controller. Bundling, routing and Web API's are some of the interesting areas in ASP.NET MVC
Check this MSDN articel[^]
- Regards - J O N
|
|
|
|
|
Ok, I agree, but you haven't answered my question. Web Pages, are they worth it?
|
|
|
|
|
Hope, you got your question answered from Dylan's response.
- Regards - J O N
|
|
|
|
|
Have a look at a response I posted to a similar question
Asp.net MVC VS Asp.Net[^]
In my opinion, MVC is a far better pattern to use for web development - once you get your head around the initial learning curve, it all becomes pretty simple
|
|
|
|
|
Yeah. To bad about legacy apps you cannot have time and resources to port to MVC
No more Mister Nice Guy... >: |
|
|
|
|
|
how to convert the nvarchar datatype to datetime
|
|
|
|
|
|
thank you friend but i want to convert the varchar dataype to datetime format (ie.)if i enter 22.3.2004 in date of birth text box it should to stored on the database as 22/3/2004 how it possible please reply me and also if the user enter like 22.3.2004 error msg has to display pls reply both
|
|
|
|
|
suriyakaqnnan wrote: i want to convert the varchar dataype to datetime format
I replied/shared the exact same question.
suriyakaqnnan wrote: f the user enter like 22.3.2004 error msg has to display
Why? If needed, put your logic on frontend or UI layer. Validate and then pass on to DB.
Try!
|
|
|
|
|
|
use below SQL function to convert DD/MM/YYYY string to Datetime..
Make sure every time u pass "DD/MM/YYYY" format only.
CREATE FUNCTION ChangeDateFormat
(
@STRING NVARCHAR(40),
@DELIMITER NVARCHAR(40)
)
RETURNS DateTime
AS
BEGIN
DECLARE @MM as varchar(5)
DECLARE @DD as varchar(5)
DECLARE @YY as varchar(5)
DECLARE @POS INT
DECLARE @NEXTPOS INT
DECLARE @INT INT
DECLARE @TEMP as varchar(50)
SET @STRING = @STRING + @DELIMITER
SET @POS = charindex(@Delimiter,@String)
SET @INT = 1
WHILE (@POS <> 0)
BEGIN
if @INT = 1
Begin
SET @DD = substring(@String,1,@Pos - 1)
End
if @INT = 2
Begin
SET @MM = substring(@String,1,@Pos - 1)
End
if @INT = 3
Begin
SET @YY = substring(@String,1,@Pos - 1)
End
SET @STRING = substring(@String,@pos+1,len(@String))
SET @POS = charindex(@Delimiter,@String)
SET @INT = @int + 1
END
SET @TEMP = @MM+'/'+ @DD + '/' + @YY
Return convert(datetime, @TEMP)
END
KiranKumar Roy
|
|
|
|
|
You can use Convert.to... in C#
or
CAST('09/25/2004'AS DATETIME)... in SQL Server
|
|
|
|