I have a winforms client application which is written in c# 4.0 that sends
a simple datatable (in a dataset) to the server , which is written in vb.net 4.0.
The datatable is sent through a web service.
both client and server are on the same computer.
This has been working fine for many years.
Now I get a strange behaviour with a datatable generated from a csv file.
Here it how it looks on the client side:
and here is the server side:
for some reason, the first row time has shifted from 2:55 AM to 03:55 in the server.
This results in a duplicate key. what's up with that?
one of the strangest bugs I've ancountered. would appreciate any help with this one -
thanks.
As suggested by #mikey,
the problem was that client used a local user account
whereas the server used the IIS acount.
One of those acounts was set to use daylightsaving time,
the other was not.
In my country, daylight saving time ended on march 29,
so this resulted in a conflict between server time and client time,
even though both were on the same computer.
Mikey , thanks again :)
Related
I'm developing a web app and trying to store some input data from a post request using asp.net core 3.1.
at first I should say that I'm using non-English language for inputs.
In local state everything goes fine, however when I publish it and try to store data in MySQL database, values are unexpected(in form of some question marks). the first thing came to my mind was maybe I used an inappropriate charset and encoding, so I change the encoding to the closest thing that I have in my local. didn't work.
I even analyzed the HTTP request and there were no problems.
then I tried to insert directly in phpMyAdmin with insert method. worked fine.
local encoding: utf8mb4_0900_ai_ci
remote encoding: utf8mb4_unicode_ci
any help would be appreciated.
The connection parameters determine the character set of the bytes in the client. To correctly store and retrieve data you must know the charset and announce it when connecting.
While transferring data between the client and server, MySQL will covert from that charset to the charset defined for the columns you are storing into / fetching from.
It sounds like you established the charset correctly for one client and incorrectly for the other.
If you can provide the hex of the characters while in the client, I can further explain.
utf8mb4_0900_ai_ci and utf8mb4_unicode_ci are different Collations for the same character set (encoding) utf8mb4. The characters will go between client and server without any transcoding. However, comparisons may cause trouble due to the different collations.
I'm working with two servers (Server 2012 Std) and (Server 2016).
On 2012 when I run the command:
[System.DateTime]::UtcNow.ToString([System.Globalization.CultureInfo]::GetCultureInfo("en-NZ"))
I get back the result:
13/03/2018 12:49:55 a.m.
When I run the same command as above on my Server 2016 I get back:
13/03/2018 12:48:42 AM
They key part is the AM/PM formatting. I'm trying to understand why these are returning different results and how to get the server 2016 output to be formatted the same as the first. This is due to an application requirement and I do not have access to change the application to format the string so I have to resolve this at the OS level somehow.
Take a look at Output of times (AM/PM) changed in Windows 10 when using DateTime.ToString("tt") for some discussion of this.
It doesn't appear that you will be able to fix this without changing application code.
I found the same problem and I was able to get around the issue by using the following code. Not sure if that's what your looking for.
[System.DateTime]::UtcNow.ToString("dd/MM/yyyy hh:mm:ss tt")
I created a windows forms application in C #, and a database MS SQL server 2008 Express, and I use LINQ-to-SQL query to insert and edit data.
The database is housed on a server with Windows Server 2008 R2 (standard edition). Right now I have the application running on five different computers, and users are authenticated through active directory.
One complaint reported to me was that sometimes when different data is entered and submitted, the same data do not appear in the listing that contains the application. I use try catch block to send the errors but errors do not appear in the application; but the data simply disappear.
The id of the table records is an integer auto-increment. As I have to tell them the registration number that was entered I use the following piece of code:
try{
ConectionDataContext db = new ConectionDataContext();
Table_Registers tr = new Table_Registers();
tr.Name=textbox1.text;
tr.sector=textbox2.text;
db.Table_Registers.InsertOnSubmit(tr);
db.SubmitChanges();
int numberRegister=tr.NumberRegister;
MessageBox.Show(tr.ToString());
}
catch{Exception e}
I wonder if I'm doing something wrong or if you know of any article on the web that speaks how to insert data from different clients in MSSQL Server databases, please let me know.
Thanks.
That's what a database server DOES: "insert data simultaneously from different clients".
One thing you can do is to consider "transactions":
http://www.sqlteam.com/article/introduction-to-transactions
Another thing you can (and should!) do is to insure as much work as possible is done on the server, by using "stored procedures":
http://www.sql-server-performance.com/2003/stored-procedures-basics/
You should also check the SQL Server error logs, especially for potential deadlocks. You can see these in your SSMS GUI, or in the "logs" directory under your SQL Server installation.
But the FIRST thing you need to do is to determine exactly what's going on. Since you've only got MSSQL Express (which is not a good choice for production use!), perhaps the easiest approach is to create a "log" table: insert an entry in your "log" every time you insert a row in the real table, and see if stuff is "missing" (i.e. you have more entires in the log table than the data table).
Really weird problem, I have just moved all our sites to a new Win2008 64bit server with IIS7 (Was on a Win2003 IIS6) and have started having problems with PayPal Pro / PayFlow.
A few of these websites are stores with SSL's and use PayPal Pro to process the payment - Since the move, intermittently I am getting errors like.
msxml3.dll error '800c0005' The
system cannot locate the resource
specified.
Where it seems I cannot connect resolve the PayPal URL to post the data to, as I say this has only started happening since we are on this new server. And what is even more annoying is that its completely intermittent!! Works fine for hours then will throw this error over and over then will be fine again, it effects both the Classic ASP and ASP.NET C# sites using PayPal??
Here is a log file entry if that helps?
2010-07-05 11:34:07 80.100.200.155
POST /scripts/60_Pay.asp
|297|800c0005|The_system_cannot_locate_the_resource_specified.__
443 - 92.8.25.196
Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.0;+WOW64;+Sky+Broadband;+GTB6.5;+SLCC1;+.NET+CLR+2.0.50727;+Media+Center+PC+5.0;+.NET+CLR+3.5.21022;+.NET+CLR+3.5.30729;+MDDC;+.NET+CLR+3.0.30729)
500 0 0 1907
Anyone have any ideas on what could be causing this? I was wondering if there was a way to increase the length of time it will wait to try and resolve from the external URL?
Any help would be GREATLY appreciated
Try setting the application pool that you are running this under to run in 32 bit mode and restart IIS. This will at least remove one variable.
Next you should check to see if you can write a very simple asp page that instantiates the xmlhttp object and tries to load a URL to make sure you don't have a network configuration that is preventing the new machine from reaching PayPal's servers (but which allowed the old machine to do so). This could be on your side, or their side.
Finally, are you able to run the code under a debugger on the server so you can figure out what line the error is happening on?
I am Making a website in ASP.Net on C#. I use 4 queries to get the data from MS SQL Server database. Now the problem is sometime I get the page in browser quickly and sometimes only the "website found waiting for reply" in status bar of IE gettinh nothing..
Please help me out.
Thanks
User Response.flush to forcefully flush the server response.
Use FireBug for client-side debugging.
(source: getfirebug.com)
No this does not happen only when I made any change to code.
Recently I used stored procedure to get the resultset from MS SQl Server database, I add one parameter of type varchar with that the result will be filtered.