How to GET current primary mouse button settings using Win32 c#
For setting the primary button I am using the SystemParametersInfoA method. const int SPI_SETMOUSEBUTTONSWAP = 33; SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, button, String.Empty, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); But for getting the…
How to add a text file in to existing datatable as a new column
I have to add a data column in to the existing data table. I need to add one more column and data to that table from a .txt file in to 0th column and from second column i need to keep the DB data. I am not using any grid view and stream reader to my…
Oracle Data Adapter recovering files don't bring special characters like ñ
Hi, I'm having an issue when I'm trying to recover data from Oracle into a DataTable. Some files in Oracle, contains characters like ñ but in the DataTable results, that character turns in this: "?" I'm using this code: static string…
Control not firing after adding to parent control
I'm creating my own ComboBox using a button with a ListBox which I add to the parent control of the button. The SelectedIndexChanged does not fire if the index is changing in the ListBox (ie user selection) but does fire if i set it in the button…
I need help with appending a child to xml using c#.
<Root> <PolicyHeader> <ReceiptNo/> </PolicyHeader> I need to replace receipt no and make like this <ReceiptNo>receipt value</ReceiptNo>
StandardPrintController.OnStartPage(PrintDocument document, PrintPageEventArgs e) is slow
What factors will affect the performance of OnStartPage(PrintDocument document, PrintPageEventArgs e) method?
How to implement XML Files into Datagrid
So i have a XML File, structure looks like so: <data> <workouts> ... <workout id="3"> <start>2021-11-22T07:10:34</start> <end>2021-11-22T08:00:00</end> …
c# forms closing and exit without saving data
Hi, Please I need help, as I am saving recording as following into oracle database at the end of code, I want my c# form will close and exit automatically, its closing and exit but without saving data please help public void…
Outer and inner loops with dictionary
I have a dictionary and I want to compare its elements. I've looped over dictionaries using foreach and KeyValuePair but what I need is the outer loop to tsrat with the first key and end at the second-to-last key, then the inner loop to start at the…
With EF Core 5, is it possible to reverse engineer (Scaffold-DbContext) a SQL view as an editable table?
I'm using Entity Framework Core 5 in my "database first" application. I use the 'Scaffold-DbContext' command to re-create the models whenever the database schema changes. It works great. However, I now have a SQL View that I need to update so…
How can I save data/information to text file and read back ?
private void SaveData(string contentToSave, string fileName) { string applicationPath = Path.GetFullPath(System.AppDomain.CurrentDomain.BaseDirectory); // the directory that your program is installed in string saveFilePath…
How to access properties of exception.
I want to access the properties of Fault Exception Object in catch block in order to catch the real cause of exception and store it into my log. The problem is , the properties are accessible only at runtime (when the exception is thrown) not…
How to automatically play a local MP4 file using WebView2 in Windows 10?
Hello: I have a number of MP4 files in my local hard drive. I want to play them automatically in WebView2. How I can do this? For example, I have one MP4 file: C:\Video2\1.mp4. I can launch ME Edge, and press Ctrl-O to open this mp4 file and…
How can I clear cookies from MS Edge programmatically using C#.NET
Like in IE we use rundll32.exe for clearing cache and cookies. For Latest version of Edge I tried using this path : LocalAppData\Microsoft\Edge\User Data\Default. In this path I tried deleting the cookies file but issue is that after deleting the…
Bridge.net .Net Framework 4.5 - You must add a reference to assembly mscorlib, Version=4.0.0.0
I'm trying to use Bridge.net, it's targeting .NET Framework 4.5 and I added a reference on the project to a custom library (.NET Framework 4.5) but when I try to inherit from a class within this library I get the error about mscorlib. I tried the only…
I cant figure out why the method returns returnVal="test" and doestn change to the correct value
this is the foreach: foreach (StudentResult item in studentResult) { LbInfo.Items.Add(item.GetInfo()); } method GetInfo() is from the Class StudentResult public string GetInfo() { …
system.text.json with dynamic object names
I have a problem with dynamic object names. Can anyone please help me with deserializing this json into c# classes: { "WohnzimmerEG": { "class": "org.openhab.core.items.ManagedItemProvider$PersistedItem", …
How can I stop/start the timer in user control through form1 ?
The user control code : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using…
Visual Studio and function Navigation bar issue
See me picture first. my function dropdown not showing full function name. there is no horizontal scrollbar at bottom of dropdown. so i am not able to show full function name. please suggest a solution. thanks
How to read data from Json object
Hi All, I am getting the data as below. Please help me how to read the data of Head_TO_Res_Det and Head_TO_Pos_Det string jsonString =…