You already have your answer but to explain Response.Redirect a little more: It is telling the Response object to redirect the user to the new page. What happens is the client gets that message and then requests somePage.aspx. So, it roundtrips but your C# thread will finish. It's essentially just adding a property to the Response object.
Server.Transfer will still finish your C# thread (finally will still run) but the client will not roundtrip. Execution will stay on the server and go to somePage.aspx and execute it and send the Response object back to the client.
There are only 10 types of people in the world, those who understand binary and those who don't.
when i m trying to update image in sql database i m getting error as"Cannot bulk load. The file "System.Byte" does not exist."
my code is as follows.pls help.
protected void Button1_Click(object sender, EventArgs e)
byte productImage = FileUpload1.FileBytes;
string constr = "Server=AOD257; Database=Edusocial;User ID=sa; Password=password";
string query = "UPDATE Profile SET [Pic] = (SELECT Pic.* from Openrowset(Bulk '" + productImage + "', Single_Blob) MyImage) where Id =11651658";
SqlConnection con = new SqlConnection(constr);
SqlCommand com = new SqlCommand(query, con);
com.Parameters.Add("@Pic", SqlDbType.Image).Value = productImage;
So I separated some write functions, that update a XML file into separate classes, that generate a thread in the background to open, update and write the XML file using streamreader and streamwriter.
So I'm new to threads on vb managed code, and just found that StreamReader is not thread safe. I did some research and one MSDN article says I need to wrap the streamreader in textreader and synchronize.
I did some more research, stumbled across monitor.enter and monitor exit, and the singleton class, so that only 1 instance of the class can run at a time.
So I have a file called "Landing.xml" and I'm interested in only have 1 instance of the class work the file at a time.
Just looking for suggestions, or help with implementing. Will post code is someone asks.
Well I tried using monitor and so far so good. So I have like 15 of these class files that handle 1 xml file each, and they seem to be queuing up correctly, and waiting politely for the previous instance of itself to complete before firing again.
So the Yandex and Baidu bots have visited, and the updates were handled without error this time over the last 3 hour test period.
Well time will tell, will check the results again in the morning.
Still interested in the Singleton concept. Not quite sure how to implement it in vb
I have established a linq connexion with my database with this code behind.
And with manually set paging for 10 records.
data is shown in ListView.
How do I get the header sorting I'm using a linkbutton. Also I want to be able to insert a dropdownlist in the header. How do I receive this functionality.
With thanks in advance.
privatevoid DisplayData(int startRow)
using (Origo.Vefur.Linq.dbMainDataContext db = new Linq.dbMainDataContext(Origo.WMMain.Helpers.Global.ConnectionString))
var empList = from el in db.owm_USERs
where el.showOnWeb == 1
ListView1.DataSource = empList.Skip(startRow).Take(10);
Is there a way to change or specify how virtual paths are resolved?
I'm creating a site on my machine, but for purposes of demonstration, I want to deploy it to a sub folder of an existing web site. So, on the web host, I have
wwwroot (which is the parent site)
wwwroot/demosite (which is the demo web site)
Of course, this means that a virtual path of "~/demosite.master" ain't gonna work, because that would resolve to "/demosite.master" instead of the desired "/demosite/demosite.master".
I tried using inline code, but of course that isn't allowed (some far-sighted MSoftie probably knew I was going to need to do this, and this is some sort of weird personal vendetta to prevent me from actually getting anything done).
What I want to do is to make the code change the various virtual paths used throughout the demosite, so that I don't have to remember to do it when I deploy to it's actual production server.
So, for localhost (when developing) and deployment onto the actual production server, I want to use the current virtual path, but for the demo version, I need to change the virtual path root.
Is that possible, and if so, how?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
When you deploy the site, you need to make sure that the "demosite" folder is an application. In IIS Manager, right-click on the folder and select "Convert to Application". Your app-relative paths (~/demosite.master) will then resolve to the correct path.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Last Visit: 31-Dec-99 19:00 Last Update: 26-Nov-14 13:38