How can I update table data? [duplicate] - c#

This question already has answers here:
string.Replace (or other string modification) not working
(4 answers)
Closed 1 year ago.
how I update this data(In Image) for visualization
-------- "31-Jan" to "31 :: Jan"
Pls, guide me.
My Data

You can not change that format at database. Your expected format you can use for visualization purpose. From the databases level it save as what format you used in DDL(data definition language).

Related

Change the modified date of a file? [duplicate]

This question already has answers here:
How to edit the modified date of a folder/file?
(2 answers)
Closed 4 years ago.
In my Local folder I have a file sample.txt.
On rightclick -> properties -> Details
I can see its modified date. For example 30.10.2018 09:00.
Can I change this property trough UWP? To 20.10.2018 09:00 for example.
Yes you can do it by the following way
string path = #"c:\sample.txt";
// Take an action that will affect the write time.
File.SetLastWriteTime(path, new DateTime(1985,4,3));

Convert from %20 to normal character (replace) [duplicate]

This question already has answers here:
decode percent-encoded string c# .net
(4 answers)
Closed 7 years ago.
I've searched for this and cannot find any hint anywhere.
Basically there is a program that formats their file name like this
hello%20world%28hello%20world%29
which is supposed to mean hello world(hello world)
now im wondering is there any way that I could read every file name and anything that uses "%ascii" would be converted to normal text (e.g above).
Thanks in advance guys. I'm not that experienced in code and I'm hoping that someone could help me.
Use System.Uri.UnescapeDataString:
Uri.UnescapeDataString("hello%20world%28hello%20world%29");
Prints:
hello world(hello world)

Get file modify date in C# [duplicate]

This question already has answers here:
Check last modified date of file in C#
(5 answers)
Closed 9 years ago.
How do I read the modify date of the file in C#?
I can read the creation date of the file by using the code below:
ModifyDate = File.GetCreationTime(FilePath)
File.GetLastWriteTime will do the job
I believe you're looking for GetLastWriteTime

how to compare two string and highlight changes? [duplicate]

This question already has answers here:
How to display word differences using c#?
(4 answers)
Closed 2 years ago.
I have two strings.
stringV1 = "123456";
stringV2 = "102300456";
First I need to compare them.
If stringV2 has some changes, this new text should be highlighted like this:
"1'0'23'00'456"
this has been discussed here already sometimes...
How to highlight the differences between subsequent lines in a file?
How to display word differences using c#?
...
Use Diff algorithm for string comparision.

Format Excel column as text [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
C# extract formatted text from Excel through OLEDB
Can i somehow format an excel column and it's data as text, before fetching the data from it ?
I'm using C# and .NET Framework 4.0
You can prefix the number by ' for example '100 will be shown as text.
Option 1
You can can try myCell.Style.NumberFormat = "#"
Here is an example online that should help give you an idea on how to use it:
Example
Option 2
Alternatively you could try grabing myCell.Text instead of myCell.Value. Value is what is actually stored in the cell, whereas Text is what is displayed.

Categories