Saturday, March 31, 2012
String was not recognized as a valid DateTime
the error:-
"String was not recognized as a valid DateTime"
<asp:Label runat="server" width="40%" text='
<%#
DateTime.Parse(DataBinder.Eval(Container,"DataItem.dt").ToString()).ToSh
ortDateString()%>' id="Label6">
*** Sent via Developersdex http://www.examnotes.net ***Well folks...
I added:-
culture="en-US"
to the globalization in Web.Config and did the trick
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
/>
*** Sent via Developersdex http://www.examnotes.net ***
Hi Patrick,
If you just use DataBinder.Eval(Container,"DataItem.dt").ToString() is
anything displayed?
If it is, I would be checking that the date format matches your Regional
Settings (System Account). If you are using SQL I��d also be checking that
the collation of the new server/database is the same as your old one.
Brad.
"Patrick Olurotimi Ige" wrote:
> I moved some projects to another server and using the code below i get
> the error:-
> "String was not recognized as a valid DateTime"
> <asp:Label runat="server" width="40%" text='
> <%#
> DateTime.Parse(DataBinder.Eval(Container,"DataItem.dt").ToString()).ToSh
> ortDateString()%>' id="Label6">
>
> *** Sent via Developersdex http://www.examnotes.net ***
>
> <asp:Label runat="server" width="40%" text='
> <%#
> DateTime.Parse(DataBinder.Eval(Container,"DataItem.dt").ToString()).To
> Sh
> ortDateString()%>' id="Label6">
Why don't you just do this instead:
<%# ((DateTime)DataBinder.Eval(Container.DataItem, "dt")).ToShortDateString(
)
%>
-Brock
DevelopMentor
http://staff.develop.com/ballen
Wednesday, March 28, 2012
String was not recognized as a valid DateTime
the error:-
"String was not recognized as a valid DateTime"
<asp:Label runat="server" width="40%" text='
<%#
DateTime.Parse(DataBinder.Eval(Container,"DataItem.dt").ToString()).ToSh
ortDateString()%>' id="Label6"
*** Sent via Developersdex http://www.developersdex.com ***Well folks...
I added:-
culture="en-US"
to the globalization in Web.Config and did the trick
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
/
*** Sent via Developersdex http://www.developersdex.com ***
Hi Patrick,
If you just use DataBinder.Eval(Container,"DataItem.dt").ToString() is
anything displayed?
If it is, I would be checking that the date format matches your Regional
Settings (System Account). If you are using SQL I'd also be checking that
the collation of the new server/database is the same as your old one.
Brad.
"Patrick Olurotimi Ige" wrote:
> I moved some projects to another server and using the code below i get
> the error:-
> "String was not recognized as a valid DateTime"
> <asp:Label runat="server" width="40%" text='
> <%#
> DateTime.Parse(DataBinder.Eval(Container,"DataItem.dt").ToString()).ToSh
> ortDateString()%>' id="Label6">
>
> *** Sent via Developersdex http://www.developersdex.com ***
> <asp:Label runat="server" width="40%" text='
> <%#
> DateTime.Parse(DataBinder.Eval(Container,"DataItem.dt").ToString()).To
> Sh
> ortDateString()%>' id="Label6"
Why don't you just do this instead:
<%# ((DateTime)DataBinder.Eval(Container.DataItem, "dt")).ToShortDateString()
%
-Brock
DevelopMentor
http://staff.develop.com/ballen
Thursday, March 22, 2012
Structure of a 3-tier application
In previous versions of Visual Studio you create a Solution and then you could add projects into it...so, a three tier app would be composed of 1 solution, and 3 projects (Business, Data, UI).
With this new approach, what would be the right structure (folders, etc.) of the application project for a 3-tier app!!??
Thanks in advance!!Visit the following: http://www.15seconds.com/issue/050721.htm
Hope this helps!
Wow, that's great!!
Thanks eccsolutions for your help!!! Just what I was looking for!
Tuesday, March 13, 2012
Strucuture of an Asp.NET Intranet
We have recently begun to upgrade our classic ASP intranet to ASP.NET.
We will be creating functional projects and different projects for
different departmental sites.
All the sites have common facets (user controls, custom controls) which
need to have available to all the projects we write and automatically
cascade to the other projects
(i.e. no rebuilding of dependent projects)
Can anyone suggest the best way of achieving this or a good source of
literature. Everything I have read so far has been a bit thin in this
area.
Many thanksthe easiest way to do this is the side by side model and a source control
system. put your shared controls in their own project. then add this project
to the solution file of each site. when you deploy a site, you will get a
copy of the shared code that was tested with the site. you can freely update
the shared code, because it will not break a running site, and a site that
needs a new feature in the shared code can ship right away, rather than
waiting for compliance testing of the change with the other sites.
-- bruce (sqlwork.com)
"Bob" <Arthur.Nyunt@.kellogg.com> wrote in message
news:1121184177.802972.227110@.o13g2000cwo.googlegr oups.com...
> Hi,
> We have recently begun to upgrade our classic ASP intranet to ASP.NET.
> We will be creating functional projects and different projects for
> different departmental sites.
> All the sites have common facets (user controls, custom controls) which
> need to have available to all the projects we write and automatically
> cascade to the other projects
> (i.e. no rebuilding of dependent projects)
> Can anyone suggest the best way of achieving this or a good source of
> literature. Everything I have read so far has been a bit thin in this
> area.
> Many thanks
Bruce,
Thanks for your reply.
I have created an empty project and created a user control, then tried
to add the project to solution file of a web application. I got a error
message saying that I was trying to access another application.
Could I just ask you
1) Is this because I need to run some source control program such as
source safe (as you mentioned source control)
2) Also could you clarify what is meant by a side by side model - I
have looked around and not found any references to this
Thanks
Arthur
i didn't read closely. usercontrols (ascx) don't share very well, as they
can not be in a seperate project (well they can but you have to fake out
vs). standard custom web controls (which i use) work fine.
to share usercontrols, it easy with a source control, because you jusrt add
a link to the shared source, and add the files to the current project.
-- bruce (sqlwork.com)
"Bob" <Arthur.Nyunt@.kellogg.com> wrote in message
news:1121187092.565144.76500@.z14g2000cwz.googlegro ups.com...
> Bruce,
> Thanks for your reply.
> I have created an empty project and created a user control, then tried
> to add the project to solution file of a web application. I got a error
> message saying that I was trying to access another application.
> Could I just ask you
> 1) Is this because I need to run some source control program such as
> source safe (as you mentioned source control)
> 2) Also could you clarify what is meant by a side by side model - I
> have looked around and not found any references to this
> Thanks
> Arthur