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?
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.
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")
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.
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
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+""
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.
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?
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)]
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.
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:
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?
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.
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.
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?
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.
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?
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
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:.........................
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?
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.