Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Saturday, March 31, 2012

String to date error

Hi guys Ive got a slight problem..

When i run my asp.net page through visual studio the application works fine, however when i puslish it and view it over myhttp://localhost page i get the following error "Conversion from string "28/8/2007" to type 'Date' is not valid." when selecting dates from a calendar control i created.

Im thinking this is some formatting issue having to do with EU/US Date format, however im not too sure about it and with a few research there are some help files stating to use globalization and once again im not sure how that works.

What im doing is assigning a date within an arraylist (which are of type dates) to a Date variable as below

Dim tempDate asDatetempDate = NewDate.Item(0) // arraylist of containing dates
Would appreciate some help regarding this issue

Thanks :)

It is a en-eu related problem. This article should help

http://msdn2.microsoft.com/en-us/library/2h3syy57.aspx
thanks that was interesting, also found out that the root to the problem was due to regional settings under the aspnet user account, my currently logged on account was set to UK however the user account aspnet was still on US therefore it kept showing dates in US format

Wednesday, March 28, 2012

String was not recognized as a valid DateTime in another server

Hi guys,

I am currently facing this problem for quite some time now.

This is my codes below :

--------------------

Dim dateBetweenAsString = txtDateBetween.Text.ToString.Trim

Dim dateToAsString = txtDateTo.Text.ToString.Trim

'stored procedure is done here<blah><blah>

.Parameters.AddWithValue("@dotnet.itags.org.DateBetween", DateTime.Parse(dateBetween))

.Parameters.AddWithValue("@dotnet.itags.org.DateTo", DateTime.Parse(dateTo))

-------------------

Everything was working perfectly on my comptuer but when I tried on another server, it prompts me "String was not recognized as a valid DateTime"

I've tried conversion on both sql and asp.net but to no avail. Can someone please help?

Ryan.

Hi Ryan,

Based on my understanding, your asp.net application works fine on your local. But you get the error message above on another server when the application tries to convert the string to DateTime. If I have misunderstood you, please feel free to let me know.

Firstly, please make sure that the DateTime format matchs the DateTime format on the server.

If the formats are different, please try to use CurrentCulture's DateTimeFormat property. For example:
DateTime dt = DateTime.Parse(dateBetween, System.Threading.Tread.CurrentThread.CurrentCulture.DateTimeFormat);

Besides, you can get more information from theStandard DateTime Format Strings.

I hope this helps.


hi Hyde,
why are u usingDim dateBetweenAsString = txtDateBetween.Text.ToString.Trim

Dim dateToAsString = txtDateTo.Text.ToString.Trim, string to declare and pass as datatime,

I think you should declare both variables as datatime, and use datatimefunction to add, subtract, format or less than or greater than function provided by Thomas.

Cheers>
Dinesh.

String.Replace() in .net 1.1 did not work!

Hi, guys,

The following source code in Page_Load() did not work:

string pathVal = "2006\";
pathVal.Replace("\\", "/");

I still had the value "2006\", not "2006/", the one I expected.

I then tried the second line as:

pathVal.Replace('\', '/');

still no luck.

Any ideas? Thanks.Replace probably returns a new string that you need to set a variable to.

"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:74E97D68-79AC-47AB-B2D3-802DF9579D77@.microsoft.com...
> Hi, guys,
> The following source code in Page_Load() did not work:
> string pathVal = "2006\";
> pathVal.Replace("\\", "/");
> I still had the value "2006\", not "2006/", the one I expected.
> I then tried the second line as:
> pathVal.Replace('\', '/');
> still no luck.
> Any ideas? Thanks.
You need to get the value value returned by Replace function. It returns
stirng variable.
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:74E97D68-79AC-47AB-B2D3-802DF9579D77@.microsoft.com...
> Hi, guys,
> The following source code in Page_Load() did not work:
> string pathVal = "2006\";
> pathVal.Replace("\\", "/");
> I still had the value "2006\", not "2006/", the one I expected.
> I then tried the second line as:
> pathVal.Replace('\', '/');
> still no luck.
> Any ideas? Thanks.
String.Replace() returns a new String value. You can always set the
returned value to the original string.

String.Replace() in .net 1.1 did not work!

Hi, guys,
The following source code in Page_Load() did not work:
string pathVal = "2006\";
pathVal.Replace("\\", "/");
I still had the value "2006\", not "2006/", the one I expected.
I then tried the second line as:
pathVal.Replace('\', '/');
still no luck.
Any ideas? Thanks.Replace probably returns a new string that you need to set a variable to.
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:74E97D68-79AC-47AB-B2D3-802DF9579D77@.microsoft.com...
> Hi, guys,
> The following source code in Page_Load() did not work:
> string pathVal = "2006\";
> pathVal.Replace("\\", "/");
> I still had the value "2006\", not "2006/", the one I expected.
> I then tried the second line as:
> pathVal.Replace('', '/');
> still no luck.
> Any ideas? Thanks.
>
You need to get the value value returned by Replace function. It returns
stirng variable.
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:74E97D68-79AC-47AB-B2D3-802DF9579D77@.microsoft.com...
> Hi, guys,
> The following source code in Page_Load() did not work:
> string pathVal = "2006\";
> pathVal.Replace("\\", "/");
> I still had the value "2006\", not "2006/", the one I expected.
> I then tried the second line as:
> pathVal.Replace('', '/');
> still no luck.
> Any ideas? Thanks.
>
String.Replace() returns a new String value. You can always set the
returned value to the original string.

Saturday, March 24, 2012

Stripping the format of files.

Hi Guys,

I am fairly new to asp.net but am embarking on a project based on asp.net I am wondering if anyone has any experience or knowledge on how to strip the formatting of different documents? Maybe for a start, how do you strip the formatting of styles and stuff in MS Words to just purely text?

Regards,

Raymond

Hi,

if you mean that you just want to get the text itself and not the colors, ... you can copy paste it into notepad and from notepad copy paste to somewhere else.

Grz, Kris.


Hi Kris,

Thanks for your input. Actually I am looking more at the coding level because I need to strip the formatting of the file automatically before I can do further comparing of the contents in string or text format.

Regards,
Raymond


Is there anyone with the relevant experience who can share their knowledge?

Thanks!

Raymond

Thursday, March 22, 2012

Structuring of large application

Hey guys,

I'm currently developing a reasonably sized application, which is
expected to grow in the future.

At the centre is the User login facility - everyone using the site must
log in. Thereafter, various different services may be available to the
user, dependant on how they are set up - there are currently two
services available:

Creditor Services
User Management

Because there are a lot of tie-ups between the services, and a lot of
shared data, all of the data resides in a single database (but
service-specific information is stored under separate schemas). A
single data-access layer provides access to the database, and the
services share session management facilities.

At present, because of the large number of tie-ups between the
services, the system is structured as a single monolythic web
application.

I tried to break it down a bit by placing service specific pages within
subdirectories. However, ASP.NET couldn't seem to cope with this, and
couldn't manage to create/find the code-behind associated with these
pages.

Even if I split the services out into completely separate web
applications, I still want them to be able to share session information
and there are a fair number of common pages/common code between them.

How would you guys suggest I go about restructuring, before the next
service comes along and makes the job even harder?

Ideally I would like the common login facility (and initial service
selection) pages to reside at the root of the site, and then for each
service to reside within a (virtual) directory below that.
Any pointers?Have you thought about possibly writing the business logic & data layer in
one application as a web service, and writing the UI in your regular web
app?

Sometimes people will assign a GUID to a user at the start of a session and
keep their current session's login information in a database, and simply
pass the GUID along to another application when they "jump over the wall",
so to speak. Again your central login database could be another web services
app.

Brandon

"Damien" <Damien_The_Unbeliever@.hotmail.com> wrote in message
news:1104919015.363665.323740@.z14g2000cwz.googlegr oups.com...
> Hey guys,
> I'm currently developing a reasonably sized application, which is
> expected to grow in the future.
> At the centre is the User login facility - everyone using the site must
> log in. Thereafter, various different services may be available to the
> user, dependant on how they are set up - there are currently two
> services available:
> Creditor Services
> User Management
> Because there are a lot of tie-ups between the services, and a lot of
> shared data, all of the data resides in a single database (but
> service-specific information is stored under separate schemas). A
> single data-access layer provides access to the database, and the
> services share session management facilities.
> At present, because of the large number of tie-ups between the
> services, the system is structured as a single monolythic web
> application.
> I tried to break it down a bit by placing service specific pages within
> subdirectories. However, ASP.NET couldn't seem to cope with this, and
> couldn't manage to create/find the code-behind associated with these
> pages.
> Even if I split the services out into completely separate web
> applications, I still want them to be able to share session information
> and there are a fair number of common pages/common code between them.
> How would you guys suggest I go about restructuring, before the next
> service comes along and makes the job even harder?
> Ideally I would like the common login facility (and initial service
> selection) pages to reside at the root of the site, and then for each
> service to reside within a (virtual) directory below that.
> Any pointers?

Tuesday, March 13, 2012

Structuring of large application

Hey guys,
I'm currently developing a reasonably sized application, which is
expected to grow in the future.
At the centre is the User login facility - everyone using the site must
log in. Thereafter, various different services may be available to the
user, dependant on how they are set up - there are currently two
services available:
Creditor Services
User Management
Because there are a lot of tie-ups between the services, and a lot of
shared data, all of the data resides in a single database (but
service-specific information is stored under separate schemas). A
single data-access layer provides access to the database, and the
services share session management facilities.
At present, because of the large number of tie-ups between the
services, the system is structured as a single monolythic web
application.
I tried to break it down a bit by placing service specific pages within
subdirectories. However, ASP.NET couldn't seem to cope with this, and
couldn't manage to create/find the code-behind associated with these
pages.
Even if I split the services out into completely separate web
applications, I still want them to be able to share session information
and there are a fair number of common pages/common code between them.
How would you guys suggest I go about restructuring, before the next
service comes along and makes the job even harder?
Ideally I would like the common login facility (and initial service
selection) pages to reside at the root of the site, and then for each
service to reside within a (virtual) directory below that.
Any pointers?Have you thought about possibly writing the business logic & data layer in
one application as a web service, and writing the UI in your regular web
app?
Sometimes people will assign a GUID to a user at the start of a session and
keep their current session's login information in a database, and simply
pass the GUID along to another application when they "jump over the wall",
so to speak. Again your central login database could be another web services
app.
Brandon
"Damien" <Damien_The_Unbeliever@.hotmail.com> wrote in message
news:1104919015.363665.323740@.z14g2000cwz.googlegroups.com...
> Hey guys,
> I'm currently developing a reasonably sized application, which is
> expected to grow in the future.
> At the centre is the User login facility - everyone using the site must
> log in. Thereafter, various different services may be available to the
> user, dependant on how they are set up - there are currently two
> services available:
> Creditor Services
> User Management
> Because there are a lot of tie-ups between the services, and a lot of
> shared data, all of the data resides in a single database (but
> service-specific information is stored under separate schemas). A
> single data-access layer provides access to the database, and the
> services share session management facilities.
> At present, because of the large number of tie-ups between the
> services, the system is structured as a single monolythic web
> application.
> I tried to break it down a bit by placing service specific pages within
> subdirectories. However, ASP.NET couldn't seem to cope with this, and
> couldn't manage to create/find the code-behind associated with these
> pages.
> Even if I split the services out into completely separate web
> applications, I still want them to be able to share session information
> and there are a fair number of common pages/common code between them.
> How would you guys suggest I go about restructuring, before the next
> service comes along and makes the job even harder?
> Ideally I would like the common login facility (and initial service
> selection) pages to reside at the root of the site, and then for each
> service to reside within a (virtual) directory below that.
> Any pointers?
>