Syntax error related to SQL Server database

I am trying to learn to work with database on visual studio. I have copied the following code from a guy on YouTube with no errors, but i still get an error. I have a problem with the following code: public partial class FormMain : Form { SqlCo...
more »

2017-11-12 19:11 (1) Answers

Porting Windows Forms to .Net Standard 2.0

Apologies if this is a very naive question. I wrote a Windows Form application using .Net 4.5 sometime ago. Recently, I thought it would be a good idea to port it to a .Net Standard 2.0 application using VS Code. There were a couple of problems with...
more »

2017-11-05 23:11 (1) Answers

Accessing secure resources in C#

In my application I need to read an encrypted file that is distributed with the app. I also need to connect to a download service using a password. My conundrum is where to store the passwords for these resources? In other languages, such as C++, ...
more »

2017-11-02 09:11 (2) Answers

Prevent Win32 from drawing classic title bar

I wanted to add a nice shadow to my borderless form, and the best way I found to do it with minimal performance loss is to use DwmExtendFrameIntoClientArea. However, this seems to be causing Windows to draw a classic title bar over the window, but it...
more »

2017-10-16 20:10 (1) Answers

C# query inside a for loop returns only one value

I am building a C# WinForms app in which users able to check with a randomly generated chassis number list if a chassis number for a specific action is connected to a part list and if yes the available part numbers are counted. Each chassis number co...
more »

2017-09-28 10:09 (1) Answers

ToolStripDropDownButton equivalency in WPF?

I'm very newbie to the WPF technology. I've been developing in WinForms for around 6 years. Now I would like to advance one big step in my skills by learning WPF. I'm reading the introduction guides in MSDN, while as a personal exercise I'm trying t...
more »

2017-09-16 06:09 (1) Answers

How to dynamically export a chart in WPF?

I am working on generating dynamically a chart and then save it to an image file (it does not have to be shown in UI.) Here is my code for chart in WPF code. <chart:PieChart Name="chart1" Style="{StaticResource Min...
more »

2017-09-12 10:09 (1) Answers

using path in other computer

How can I use my database with another computer without changing the path? I'm using this path SQLiteConnection conn = new SQLiteConnection( "data source=C:\\Users\\users\\Documents\\Visual Studio 2012\\Projects\\SKM Computerized Payroll System\\d...
more »

2017-08-27 06:08 (1) Answers

Get timespan of every row in datagridview in C#

So I doing a small agenda and I will insert the to-do list into a database and populate it in the DataGridView along with the DateTime.Now when I saved it. If I forget to do something of that list it will display a notification and tell me that I for...
more »

2017-08-09 16:08 (3) Answers

Dynamic XSLT generation based on changes in XSD

Initially I had various XSD definition for each XSD I had set of XML files stored. After some time duration there are some changes in XSD definition so my stored XML is no more validation again new XSD. For support I need to write XSLT and do chang...
more »

2017-08-01 09:08 (1) Answers

Create Save And Load Functionality For A Winform

I have a winform with 5 text boxes and 2 data grids. I need a way of being able to press a button (or adding a menu at the top with a file button and select save from there) and save all of the values to a file that the user selects location/name fo...
more »

2017-07-28 02:07 (1) Answers

VB.NET - Can't get Integer to work

I'm working with Windows Forms Application in Visual Studio 2015, using .NET Framework 4.5.2. So I'm making a simple program which includes a label to display a value. The label (called lblMoney) displays the currency (in this case, $) and then the v...
more »

2017-07-15 23:07 (3) Answers

C# ArgumentOutOfRangeException when closing forms

I am writing a WinForms C# Program. I am trying to close all forms except my main form, FrmMain. I must hide my main form. I produced this by having two forms open. One with my main form, and one with another form shown with the ShowDialog() metho...
more »

2017-07-09 06:07 (1) Answers

How to get wpf window instance from winforms

After login I'm opening this Mainwindow MainWindow window = new MainWindow(); and closing the Login window. In the main window there is a windows form I'm initializing globally Scanner form = new Scanner(); I'm hiding and showing this Scanner ...
more »

2017-07-01 10:07 (3) Answers

Properly detect keyboard layout

I have a winforms application where I need to obtain the current keyboard layout of the user. To do that I'm using System.Windows.Forms.InputLanguage.CurrentInputLanguage.LayoutName. This works fine as long as the user has the form as his active win...
more »

2017-07-01 01:07 (2) Answers