Wrong Firstdayofweek Set In VB.NET?

Feb 23, 2011

I am working on I am getting the wrong week day for the current day i.e today

Response.Write(WeekdayName(Weekday(System.DateTime.Now)))

I am getting Thursday, where does this default get set or where can I change it. And it thinks day of the week is 4.

View 2 Replies


Similar Messages:

State Management :: Data Being Saved To Wrong Table In Wrong Instance Of Sqlserver Of Wrong Database?

Aug 1, 2010

I have a weird thing happening. I have two identical databases installed on one virtual machine but under two different instances of SQLServer. For some reason, periodically when saving from one it will save to the other instead. Using debug, I have verified that the connection string is correct and when the item saves, it still saves to the wrong database.I use session variable, and am of the belief that it might have something to do with it...and t hat when I go from one to the other it is still getting the connection string form the other for some reason.To make sure that it isn't a problem, I make sure that I completely close out one database before opening the other in a new IE window.I assume that when I completely close out an internet explorer window that it abandons all session states. Is that true?

View 7 Replies

ADO.NET :: Data Saving To Wrong Database On Wrong Instance Of Sqlserver

Aug 1, 2010

I have a very weird thing happening. I have two databases that have exactly the same tables but different database names on the same virtual machine, but in different instances of SQL Server. For some reason, when using one of them, it will save to the other. In debug, looking at my connection string..I have verified that it is correct, yet when I allow the save, I look in the table and it isn't there, it is in the other database that is in a table with a completely different name and in a different instance of SQL Server.

View 1 Replies

MVC :: Url Becomes Wrong When Using Id On Action?

Jan 12, 2010

I have the following in my JQuery code:

icon.image = "../Contents/Image/GoogleMapMarker_Icon.png";

This works fine when I am on the url:

http://localhost:65125/Center

But if I pass an Id to the action and get the following url:

http://localhost:65125/Center/3

The image is not loaded and I get a 404 error. I was checking with with Firebug and I get:

http://localhost:65125/Center/Index/Contents/Image/Marker_Icon.png

Instead of:

http://localhost:65125/Contents/Image/Marker_Icon.png

View 7 Replies

What's Wrong With This SQL Server Query

Jan 15, 2011

What's wrong this T-SQL query :

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SQLData As New System.Data.SqlClient.SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True")

[code]...

View 3 Replies

WCF And Json / Wrong Serialization

Feb 2, 2010

Why this WCF 3.5 method

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Json
{
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
public string Upper(string text)
{
return text.ToUpper();
}
}

returns {"d":"TEXT"} ?
It should returns {"TEXT"}
I'm calling using jQuery.
$("#upper").click(function() {
$.ajax({
type: "GET",
url: "/Json.svc/Upper?text="+$("#input1").val(),
success: function(data) {
$("#input1").val(data.d);
}
});
});

View 2 Replies

Wrong Login Used When Using NHibernate For ORM

Feb 12, 2010

I have an ASP.NET v2 website which uses NHibernate for ORM. My current architecture is not that great and I will be changing it after reading some best practices but I wish to still try and figure out my current problem. I have a login screen which creates a ISessionFactory with the connection string set appropriately to the user name and password entered. The SessionFactory is then stored in HttpRuntime.Cache (all objects stored in the HttpRuntime.Cache have an expiration of 30 minutes which is not ideal and may cause issues but hopefully is not relevant to this particular case).

Whenever a data query is made the application tries to retrieve a Session from HttpContext.Current. The first time this occurs no Session is present so one is created from the SessionFactory and stored for future reference. The same Session is therefore is used throughtout the application which is not ideal I believe and it is not explicity closed after each operation. There have been various issues with the application including timeouts which may be associated with not closing connections after each operation. An error that has recently appeared is:

Message: Login failed for user 'myusername'.
Type: System.Data.SqlClient.SqlException
Source: .Net SqlClient Data Provider
Stack Trace: at
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)

This is only after a few minutes of using the application so should not be related to the use of HttpRuntime.Cache. The username in the exception (myusername) does not match the user specified in the connection string! Does anyone have any idea of what could cause this. I was thinking of ConnectionPooling but understand that the connection is made from a pool keyed on user name and password so it shouldn't confuse users. I am changing the application to use an IHttpModule to create a session per request which will be explicity closed after each operation but I would still like to know what causes the current problem.

View 1 Replies

C# - What Is Wrong With This File Path

Jan 7, 2010

I have two folders called CSVLoad and Forms... I have an aspx page inside forms folder which has a fileupload control. I save my uploaded file to my CSVLoad folder i gave the following path

FileUpload1.SaveAs(Server.MapPath("CSVLoad//" + FileUpload1.FileName));
I am receiving file not found exception.
Could not find a part of the path
'F:WebSitesPayrollFormsCSVLoadEmployeesdata.csv'
CSVLoad folder is outside Forms folder (ie) both are root level folders of my application

Answer :

FileUpload1.SaveAs(Server.MapPath("~/CSVLoad//" + FileUpload1.FileName));[URL]

View 1 Replies

ADO.NET :: Update SQL Statement Wrong?

Aug 26, 2010

im trying this query but i get a error at the very end of the statement at [BookingNumber] ---- The error IS: Incorect Syntax near [BookingNumber]

"UPDATE ["+txtDBNameSql+"].[dbo].[Bookings] SET [ItemPrice]="+Price+",[ItemCode]="+Code+",[Status]="+Status+",[Clientescription]="+ClientDesc+",[ArrivalDate]="+arrival.ToShortDateString()+",[DepartureDate]="+depature.ToShortDateString()+",[DurationCharged]="+Nights+",[ClientCode]="+clientCode+"
WHERE [BookingNumber]="+WebBookingNo+""

View 2 Replies

Getting The Wrong Client IP Address?

Apr 10, 2010

I am running an ASP.NET application. The web server is located on the same system. In the code behind I just want to get the IP address of the requesting client. I am using this code:

Request.UserHostAddress

But I am getting a wrong address: 127.0.0.1. My system IP address is 198.162.0.27.

View 1 Replies

Web Forms :: Email Comes In Wrong Format?

Feb 5, 2010

why the email attachments that my application sends sometimes ( maybe 1 out of a 100) come in the text format. Rather in raw markup format, not rendered?

View 4 Replies

MVC :: Wrong Action Invoked In Controller

Apr 8, 2010

Im fairly new to Asp.Net MVC. I spent some time to fix this but I get it to work. What I have is a:

QuestionController : Controller
{
public ActionResult Add()
{
//do stuff
}
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Add(int roomuid)
{
//do stuff
}
}

now in my view i have : <a href = "/Question/Add">click here </a> The strange thing is that public ActionResult Add(int roomuid) is called and not Add() without get parameters. Even if I change the [AcceptVerbs(HttpVerbs.Get)] to [AcceptVerbs(HttpVerbs.Post)]

View 1 Replies

MVC :: ASP 2: Wrong Render Of The Model After Posting

Oct 4, 2010

I have faced with some strange behavior and I hope you will be able to tell, what I do wrong. My goal is to change the order of some object. This object has property Priority which defines the order. Objects render as a list and user can drag elements for prepare order. When user click save, JS code modifies Priority property in hidden fields in accordance with order of elements in the list. And this form is sent to the server.

View 5 Replies

C# - Entity Framework Looking For Wrong Column?

Mar 12, 2011

I'm brand new to the Entity Framework and trying to learn all it can offer. I'm currently working my way through the MVC Music Store tutorial which includes the following code:

[code].....

View 3 Replies

Web Forms :: Which Should Use, ToolkitScriptManager Or ScriptManager , And What Will Going Wrong

Jan 14, 2011

I use scriptmanager instead of toolscript manager and don't seem to have problems. But I have noticed that the recommendation is to use toolscriptmanager. Is there any difference now?

View 1 Replies

Sql Server - App Pointing To Wrong Database

Feb 28, 2011

I've got a web app that uses a MS SQL Server 2008 database. Recently I made two copies of the database, one for ongoing development, the other for users to begin testing and evaluting the application.

I've got two seperate web applications now. I've changed the web.config of the 'test' version to point to the test DB, but it still seems to be using the previous version.

Is this cached somewhere? I've run IISRESET on the box, but the the 'test' version of my web app still seems to point to the wrong DB.

View 3 Replies

C# - GetUtcOffset Returning Wrong Timezone?

May 13, 2010

for some reason when I use the following code

TimeSpan timeDiffUtcServer = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);

it returns -07:00:00 offset

I am using Windows XP and my timezone is set to Pacific time -08:00. I am running this through VS 2010's built in IIS server which is on my computer, so I can't figure out why the discrepancy in time.

View 1 Replies

ReCaptcha Accepts Wrong Answers Sometimes?

Jun 17, 2010

We are using recaptcha ASP.NET control:[URL]However, we find that in some situations, recaptcha accepts answers which are clearly wrong.For example, recaptcha provided these words: of purserThe tester typed in the following: o purser ..but Page.IsValid returned true! Is this a known issue with recaptcha?

View 1 Replies

MVC :: Session Showing Wrong Value In IIS7?

Dec 10, 2010

We have developed MVC web app. We have used session value only once within the application to save the visibility.

I save the visibility selected in dropdown in session and when the page refreshes next time I set the drop down value based on session.

The code is as follows:

if (visibility == "All Investors")
visibility = "All";
Session["visibility"] = visibility;
if (Session["visibility"] != null )
{
visibility = Session["visibility"].ToString();
}

This works well on my local in all cases. On test server , sometime I get right session value but some time I get session value which was set before the last session value, The only difference in the environment I have on local and test is local has IIS6.0 and test has IIS7.0.

View 3 Replies

Web Forms :: Wrong Colors After Refresh?

Jun 16, 2010

I am using ASP.NET 2.0. I have a web appication that is using master pages and themes. When a page loads or is refreshed, you can see the controls and back ground cycle through some different colors before it settles on the colors defined in the theme. Somtimes the colors don't get painted properly. I have seen some of the areas on the page painted a light purple instead of the theme defined grey. We always see the back ground go from white->purple->black. Black is the defined color.

I have tried setting the theme in the web.config using the <pages theme= />.

I have tried setting the theme in code by overriding PreInit.

Is there a way to set the default colors so that I can make the page default colors match the ones in my theme so that I won't see the trasnistions when the page paints? Or is the a better way to set colors so that the pages look nicer?

View 1 Replies

C# - Debug Wrong Copy Of Project In MVC?

Feb 10, 2011

i just upgrade my MVC 1 project to MVC 3. and now in my current project [MVC3] have no views as old have.

when i run them or debug i found that everything i can see means all pages i can see by debug this blanks views project who still not have any views. i am wonder. i restart them and try by disk cleaning but their is nothing goes right. don't wonder if you not understand it:-

i have two project [first in MVC1 and 2nd in MVC3] MVC1 project have views. MVC3 project still not have any views but for testing i make blanks page. i wonder by debugging blanks views MVC3 project i can see everything who already My MVC1 project have. why this problem come are reason is that same name of both project. i am trying this when i run only project MVC3 [no-views] but they show me everything i can see in MVC1 project. well are their any way to solve this problem

NExT STEP:

i found that the problem is that i have two copy of a project. first in MVC 1 and 2nd in MVC 3 [razor] i found that when i run in MVC3 project who is in D drive the code they debug is MVC1 who is in C drive. i find out this by checking server.mappath i wonder how they debug mvc1 project when i debug MVC3 project

View 1 Replies

Configuration :: Deployed DLL Contains Wrong Paths?

Sep 30, 2010

This may be a dumb question, but I've got a DLL that I compile and reference locally in a web site project and everything runs just fine. When I deploy this solution to the test server, I get an "Object reference not set to an instance of an object." error and the stack trace displays the files with their paths that are causing the error. The thing is, the paths being displayed are the absolute path as they existed on my development machine. Here's the stack trace:.........................

View 3 Replies

Wrong Place For Float:left Div?

Sep 1, 2010

<div id="nav-main" align="center" style="width: 95%; height: 35px;">
<div style="float:left; height: 29px; width: 260px;">
<a href="javascript:void(0);" onclick="select();"

[code]...

View 2 Replies

Drop Down Firing Wrong Event?

Jan 4, 2011

I'm using VS 2010, .net 4, vb.net. I have an asp.net site and on a page have 2 drop down lists.

<asp:DropDownList ID="ddlClassIndex" runat="server" AutoPostBack="true" />
<asp:DropDownList ID="ddlClassQBankList" runat="server" AutoPostBack="true" />

When the page first loads i can click on either of these, select an item and the event fires correctly. When i select either of the drop down boxes as a second operation, the first drop down, ddlClassIndex.SelectedIndexChanged fires. What have i done wrong that this would be happening. I do a page.ispostback=false check when the page loads and we are also using master pages.

Private Sub LoadClass()
Dim Os As List(Of Dempsey.OldeTestClassIndex) = Nothing
Dim Oc As New Dempsey.OldeTestClassIndex_Controller
Os = Oc._GetClassIndexData(0)
Dim X = From w In Os
Where w.Active = 3
Select w
Os = X.ToList
With Me.ddlClassIndex
.DataSource = Os.OrderBy(Function(o) o.ClassTitle)
.DataTextField = "ClassTitle"
.DataValueField = "tblClassIndexID"
.DataBind()
.Items.Insert(0, New ListItem("Choose Class Title", "0"))
.SelectedIndex = 0
End With
End Sub

Protected Sub ddlClassIndex_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlClassIndex.SelectedIndexChanged
If Me.ddlClassIndex.SelectedIndex > 0 Then
If ClassHasCategories(Me.ddlClassIndex) = True Then
Response.Redirect("AddEditQBank.aspx?ClassIndexID=" & Me.ddlClassIndex.SelectedItem.Value)
Else
Me.lblStatus.Text = "No Categories"
Me.lblStatus.Visible = True
End If
End If
End Sub

Private Sub LoadClassQBankList()
Dim ary As New ArrayList
ary.Add(1)
ary.Add(2)
ary.Add(3)
Dim Os As List(Of Dempsey.OldeTestClassIndex) = Nothing
Dim Oc As New Dempsey.OldeTestClassIndex_Controller
Os = Oc._GetClassIndexData(0)
Dim X = From w In Os Join l In ary On w.Active Equals l
Where w.KT = 1 And w.RandomTest = 1
Select w
Os = X.ToList
With Me.ddlClassQBankList
.DataSource = Os.OrderBy(Function(o) o.ClassTitle)
.DataTextField = "ClassTitle"
.DataValueField = "tblClassIndexID"
.DataBind()
.Items.Insert(0, New ListItem("Choose Class Title", "0"))
.SelectedIndex = 0
End With
End Sub
Protected Sub ddlClassQBankList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlClassQBankList.SelectedIndexChanged
If Me.ddlClassQBankList.SelectedIndex > 0 Then
Response.Redirect("ClassQBankList.aspx" & "?ClassIndexID=" & Me.ddlClassQBankList.SelectedValue)
End If
End Sub

~~~~~~~~~~

More info
I am checking for page postback. When i select from the drop down, it redirects to a different page. When i click the back button and selected another value in the other drop down, both SelectedIndexChanged fire. So i do i need to do something with viewstate? before i redired to the other page?

View 1 Replies

C# - Due Date Set Via EWS Is Wrong In Reminder Popup?

Apr 21, 2010

I'm having some trouble using EWS with tasks and reminders, specifically, the due date.

When I run my code, shown below, the task is added to my exchange account and I can see it fine in outlook. All the data in it looks fine too. However, if I specify to have a reminder for the task, the due date it shows is very wrong.

It's usually 17 hours in the future, but the screenshot I've provided shows it being 19 hours in the future. I'm finding it very strange that if I open the task, the due date looks fine, but the reminder is saying it is due well into the future.

Screenshot: http://s970.photobucket.com/albums/ae187/paulehn/?action=view¤t=ewstask.jpg

ExchangeVersion exchVersion = new ExchangeVersion();
exchVersion = ExchangeVersion.Exchange2007_SP1;
ExchangeService service = new ExchangeService(exchVersion);
service.UseDefaultCredentials = true;
service.Url = new Uri("https://mail.domain.com.au/ews/exchange.asmx");
Task task = new Task(service);
task.Subject = "Subject";
task.Body = new MessageBody(BodyType.HTML, "Body");
task.StartDate = DateTime.Today;
task.DueDate = DateTime.Now.AddHours(2);
task.ReminderDueBy = DateTime.Now;
task.ReminderMinutesBeforeStart = 15;
task.IsReminderSet = true;
task.Save();

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved