none
What is wrong? RRS feed

  • Question

  • using System;
    using System.Data;
    using System.Data.SqlClient;
    using System.Windows.Forms;

    namespace Example1
    {
        public partial class Form1 : Form
        {
            private SqlConnection cnn;

            public Form1()
            {
                InitializeComponent();
            }

            private void txtserver_TextChanged(object sender, EventArgs e)
            {

            }

                  private void txtlogin_TextChanged(object sender, EventArgs e)
            {

            }

            private void txtpassword_TextChanged(object sender, EventArgs e)
            {

            }

            private void button1_Click(object sender, EventArgs e)
            {
                SqlServerLogin login = new SqlServerLogin();
                login.LoginUser(this.txtlogin.Text, this.txtpassword.Text, this.txtserver.Text);
                SqlCommand command;


                command = new SqlCommand("create table hawk.dbo.trans(tx_date datetime, tr_name varchar, weight int");
                command.ExecuteNonQuery();
                



            }
            public class SqlServerLogin
            {
               
               
                /// <param name="tax"
                /// <param name="demo123"
                /// <param name="N10468000115\SQLHUNTER"
                
                public bool LoginUser(string userName, string userPassword, string serverName)
                {
                    var ConnectionString = $"Server={serverName};" +
                                       $"User Id={userName};" +
                                    $"Password={userPassword};";
                    using (var cn = new SqlConnection { ConnectionString = ConnectionString })

                    {
                        try
                        {
                            cn.Open();
                            if (cn.State == ConnectionState.Open)
                            {
                                MessageBox.Show("connection succeeded!");
                            }
                            return true;
                        }
                        

                        catch (Exception e)
                        {
                            return false;
                        }
                    }
                }
                
            }
        }
    }
    Wednesday, October 2, 2019 6:39 AM

Answers

All replies

  • If you create and open the connection (such as the cnn member of Form1, or return it unclosed from LoginUser), then this should work:

       command = new SqlCommand("create table . . .", cnn);

    Wednesday, October 2, 2019 6:56 AM
  • Your SQL statement missed a closing ')'.

    And just as Viorel_ mentioned, you probably forgot to check the result of your LoginUser(). There could be some exception thrown when trying to create the connection, and your function ate that and just return false, which you simply ignored and discarded.

    Wednesday, October 2, 2019 7:45 AM
    Answerer
  • Do not work, the same error
    Wednesday, October 2, 2019 8:36 AM
  • Write correct code, please
    Wednesday, October 2, 2019 8:43 AM
  • You do pass the cnn as second parameter of SqlCommand?

    Does it contains value?

    Just as I said before, in your LoginUser() function it just eat any error message when initializing connection, and it can just contain null here.

    Try add throw; to make the actual error display here in order to understand what is wrong.

                public bool LoginUser(string userName, string userPassword, string serverName)
                 {
                     var ConnectionString = $"Server={serverName};" +
                                        $"User Id={userName};" +
                                     $"Password={userPassword};";
                     using (var cn = new SqlConnection { ConnectionString = ConnectionString })
    
                     {
                         try
                         {
                             cn.Open();
                             if (cn.State == ConnectionState.Open)
                             {
                                 MessageBox.Show("connection succeeded!");
                             }
                             return true;
                         }
                         
    
                         catch (Exception e)
                         {
                             throw; // add this line
                             //return false;
                         }
                     }
                 }

    Wednesday, October 2, 2019 9:28 AM
    Answerer
  • Wednesday, October 2, 2019 10:25 AM
  • Hello,

    Here is a simple example which is more secure by using SqlCredential class to secure the user password. You will need to change the variable ConnectionString to set the Data Source (the server) and Initial Catalog to the database you want to work with.

    public void SqlCredentialExample()
    {
        var ConnectionString = "Data Source=.\\SQLEXPRESS;Initial Catalog=UserLoginExample";
        var userName = "KarenPayne";
        var password = "password1";
    
        var securePassword = new SecureString();
    
        foreach (var character in password)
        {
            securePassword.AppendChar(character);
        }
    
        securePassword.MakeReadOnly();
    
        var credentials = new SqlCredential(userName, securePassword);
    
        using (var cn = new SqlConnection { ConnectionString = ConnectionString })
        {
            cn.Credential = credentials;
            cn.Open();
        }
    }

    An even better way is to pass user name and password to the login encrypted and decrypt in the login method.

    public SqlServerLoginResult SqlCredentialLogin(byte[] pNameBytes, byte[] pPasswordBytes)
    {
        var loginResult = new SqlServerLoginResult();
        var secureOperations = new Encryption();
    
        var userName = secureOperations.Decrypt(pNameBytes, "111");
        var userPassword = secureOperations.Decrypt(pPasswordBytes, "111");
    
        string connectionString = $"Data Source={serverName};" + 
                                  $"Initial Catalog={catalogName};";
    
    
        var securePassword = new SecureString();
    
        foreach (var character in userPassword)
        {
            securePassword.AppendChar(character);
        }
    
        securePassword.MakeReadOnly();
    
        var credentials = new SqlCredential(userName, securePassword);
    
        using (var cn = new SqlConnection {ConnectionString = connectionString})
        {
            try
            {
                cn.Credential = credentials;
                cn.Open();
                loginResult.Success = true;
            }
    
            catch (SqlException failedLoginException) when (failedLoginException.Number == 18456)
            {
                loginResult.Success = false;
                loginResult.GenericException = false;
                loginResult.Message = "Can not access data.";
            }
            catch (SqlException genericSqlException)
            {
                loginResult.Success = false;
                loginResult.GenericException = false;
                loginResult.Message = "Can not access data.";
            }
            catch (Exception ex)
            {
                loginResult.Success = false;
                loginResult.GenericException = true;
                loginResult.Message = ex.Message;
            }
    
        }
    
        return loginResult;
    
    }
    Full source code.

    Also note is not recommended to have a connection object that is setup as you have, instead create the connection as I have done above in a using statement.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, October 2, 2019 10:33 AM
    Moderator
  • So what to do with your code, where I must paste it in my code? What must be deleted in my code? 
    Wednesday, October 2, 2019 11:15 AM
  • So what to do with your code, where I must paste it in my code? What must be deleted in my code? 

    Create a form to capture user name and password e.g.

    Code behind the form.

    using System;
    using System.Windows.Forms;
    using LoginLibrary.DataClasses;
    using LoginLibrary.SecurityClasses;
    
    namespace LoginSqlCredentialExample
    {
    	public partial class LoginForm
    	{
    		public LoginForm()
    		{
    			InitializeComponent();
    		}
    
    		private void LoginButton_Click(object sender, EventArgs e)
    		{
    
    			if (!string.IsNullOrWhiteSpace(UserNameTextBox.Text) && !string.IsNullOrWhiteSpace(PasswordTextBox.Text))
    			{
                    /*
                     * Change KARENS-PC to your server name (of your instance of SQLEXPRESS)
                     * Change UserLoginExample to your database name
                     */
                    var ops = new DatabaseUser("KARENS-PC", "UserLoginExample");
    				var tester = new Encryption();
    
    				// encrypt user name and password
    				var userNameBytes = tester.Encrypt(UserNameTextBox.Text, "111");
    				var passwordBytes = tester.Encrypt(PasswordTextBox.Text, "111");
    
    				var results = ops.SqlCredentialLogin(userNameBytes, passwordBytes);
    
    				//
    				// Login recognized (does not know if the user has proper permissions to the tables at this point)
    				//
    				if (results.Success)
    				{
    					MessageBox.Show("Login successful");
    				}
    				else
    				{
    					MessageBox.Show(results.Message);
    				}
    			}
    			else
    			{
    				MessageBox.Show("Incomplete information to continue.");
    			}
    		}
    
    		private void CancelButton_Click(object sender, EventArgs e)
    		{
    			Close();
    		}
    	}
    }
     

    This snippet, is true the login was successful, if failed then the error message is displayed which can range from not fully setting up the user login e.g. needed permissions to the database to feeding the incorrect server name or database.

    One thing that can happen too is a user login is perfect but the instance of the SQL-Server service requires a restart from Task Manager, Services as per below while the service name may be different dependent on version and edition installed.

    if (results.Success)
    {
    	MessageBox.Show("Login successful");
    }
    else
    {
    	MessageBox.Show(results.Message);
    }


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, October 2, 2019 12:10 PM
    Moderator
  • using System;
    using System.Windows.Forms;
    using LoginLibrary.DataClasses;
    using LoginLibrary.SecurityClasses;

    namespace Entrance
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void txtserver_TextChanged(object sender, EventArgs e)
            {

            }

            private void txtlogin_TextChanged(object sender, EventArgs e)
            {

            }

            private void txtpassword_TextChanged(object sender, EventArgs e)
            {

            }

            private void checkBox1_CheckedChanged(object sender, EventArgs e)
            {

            }

            private void OK_Click(object sender, EventArgs e)
            {
                if (!string.IsNullOrWhiteSpace(txtlogin.Text) && !string.IsNullOrWhiteSpace(txtpassword.Text))
                {
                    /*
                     * Change KARENS-PC to your server name (of your instance of SQLEXPRESS)
                     * Change UserLoginExample to your database name
                     */
                    var ops = new DatabaseUser("N10468000115\SQLHUNTER", "demo");
                    var tester = new Encryption();

                    // encrypt user name and password
                    var userNameBytes = tester.Encrypt(txtlogin.Text, "111");
                    var passwordBytes = tester.Encrypt(txtpassword.Text, "111");

                    var results = ops.SqlCredentialLogin(userNameBytes, passwordBytes);

                    //
                    // Login recognized (does not know if the user has proper permissions to the tables at this point)
                    //
                    if (results.Success)
                    {
                        MessageBox.Show("Login successful");
                    }
                    else
                    {
                        MessageBox.Show(results.Message);
                    }
                }
                else
                {
                    MessageBox.Show("Incomplete information to continue.");
                }
            }

            
            

            private void Cancel_Click(object sender, EventArgs e)
            {
                Close();
            }
        }
    }
    Wednesday, October 2, 2019 2:19 PM
  • So the user you supplied in connection string cannot login to SQL server. (For security reason it will not tell you whether it's the username is incorrect, or the password is wrong)

    You should consult the SQL server admin to get the correct username+password to connect.


    Thursday, October 3, 2019 1:39 AM
    Answerer
  • Hi pavlob,

    Thank you for posting here.

    You miss the reference in the code. Follow the steps in the links below.

    https://www.c-sharpcorner.com/UploadFile/9582c9/login-form-with-sql-in-C-Sharp/

    https://www.c-sharpcorner.com/article/login-form-in-c-sharp-connected-with-database-for/

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 3, 2019 1:48 AM
    Moderator
  • Did you add LoginLibrary and SupporLibrary as references. In the image below there are two windows forms projects where either or requires these references to complete the login.

    SupportLibrary is for exceptions while LoginLibrary is for login and reading data. The reading data part will be broken out but works "as is".

    This entire solution started last week and is still going through changes but does work now, just being refined.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, October 3, 2019 2:31 AM
    Moderator
  • For some reason, I feel it's like providing someone a swiss knife hammer when he only need ordinary hammer, when he can't nail something.

    It's way more complicated than what he asked for help.

    Thursday, October 3, 2019 3:05 AM
    Answerer
  • For some reason, I feel it's like providing someone a swiss knife hammer when he only need ordinary hammer, when he can't nail something.

    It's way more complicated than what he asked for help.

    It's not a swiss knife hammer as you put it. The code I've presented in a solid way to prevent most attempts at unauthorized access while what they started out with does not prevent someone from learning what the server name is and gain access to the data while creating user login and permissions server level circumvents this, especially when using SqlCredential class method in tangent with user login/strict permissions. They can say they don't want this but have not heard that so far.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, October 3, 2019 3:12 AM
    Moderator
  • The fact that the first thing his code trying to do is to create a new table without checking for the existance suggest that this is probably part of a greater homework/exercise, so I would just give reason why the code fail and what he should do.

    But whatever... it won't hurt this way.

    Thursday, October 3, 2019 3:42 AM
    Answerer
  • Greetings everyone.

    I tend to be on Cheong's side, in that beginners or those who are not fluent in the language can become bewildered when they don't get a simple answer to a simple question about why a line of code doesn't work. With that in mind, is seems clear (I think. I'm always a bit unsure about SQL) that the original problem is that the connection isn't being passed back from LoginUser so it can be passed to the command.

    So here's my suggestion.

          private void button1_Click(object sender, EventArgs e)
          {
             SqlServerLogin login = new SqlServerLogin();
             if (login.LoginUser(this.txtlogin.Text, this.txtpassword.Text, this.txtserver.Text, ref cnn))
             {
                SqlCommand command;
    
    
                command = new SqlCommand("create table hawk.dbo.trans(tx_date datetime, tr_name varchar, weight int", cnn);
                command.ExecuteNonQuery();
             }
          }
    
          public class SqlServerLogin
          {
    
    
             public bool LoginUser(string userName, string userPassword, string serverName, ref SqlConnection cn)
             {
                var ConnectionString = $"Server={serverName};" +
                                   $"User Id={userName};" +
                                $"Password={userPassword};";
                cn = new SqlConnection { ConnectionString = ConnectionString };
    
                try
                {
                   cn.Open();
                   if (cn.State == ConnectionState.Open)
                   {
                      MessageBox.Show("connection succeeded!");
                   }
                   return true;
                }
    
    
                catch (Exception e)
                {
                   return false;
                }
    
             }
    
          }
    

    Thursday, October 3, 2019 4:36 AM
  • Thursday, October 3, 2019 8:06 AM

  • Thursday, October 3, 2019 8:07 AM
  • Did you add LoginLibrary and SupporLibrary as references. In the image below there are two windows forms projects where either or requires these references to complete the login.

    SupportLibrary is for exceptions while LoginLibrary is for login and reading data. The reading data part will be broken out but works "as is".

    This entire solution started last week and is still going through changes but does work now, just being refined.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    How to add references?
    Thursday, October 3, 2019 8:59 AM
  • Did you add LoginLibrary and SupporLibrary as references. In the image below there are two windows forms projects where either or requires these references to complete the login.

    SupportLibrary is for exceptions while LoginLibrary is for login and reading data. The reading data part will be broken out but works "as is".

    This entire solution started last week and is still going through changes but does work now, just being refined.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    How to add references?
    https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019#projects-tab

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, October 3, 2019 9:38 AM
    Moderator

  • Re the CS1501: Your original class 

    public class SqlServerLogin
        {        
        public bool LoginUser(string userName, string userPassword, string serverName)
            
    

    has a LoginUser method that takes three arguments.

    But the class posted by Ante

    public class SqlServerLogin
    {
       public bool LoginUser(string userName, string userPassword, string serverName, ref SqlConnection cn)
       {
    

    has a LoginUser method that takes four arguments.

    Did you use Ante's class or are you still using your original class?

    Re the CS0642: You have a semi-colon at the end of the if() statement. Remove it.

    - Wayne

    Thursday, October 3, 2019 9:56 AM
  • using System;
    using System.Data;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    
    namespace Example1
    {
        public partial class Form1 : Form
        {
            private SqlConnection cnn;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void txtserver_TextChanged(object sender, EventArgs e)
            {
    
            }
    
                  private void txtlogin_TextChanged(object sender, EventArgs e)
            {
    
            }
    
                   private void txtpassword_TextChanged(object sender, EventArgs e)
            {
    
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                SqlServerLogin login = new SqlServerLogin();
                if (login.LoginUser(this.txtlogin.Text, this.txtpassword.Text, this.txtserver.Text, ref cnn))
                {
                    SqlCommand command;
                    command = new SqlCommand("create table hawk.dbo.trans(tx_date datetime, tr_name varchar, weight int", cnn);
                    command.ExecuteNonQuery();
    
    
    
    
                }
            }
            public class SqlServerLogin
            {
               
               
                /// <param name="tax"
                /// <param name="demo123"
                /// <param name="N10468000115\SQLHUNTER"
                
                public bool LoginUser(string userName, string userPassword, string serverName, ref SqlConnection cn)
                {
                    var ConnectionString = $"Server={serverName};" +
                                       $"User Id={userName};" +
                                    $"Password={userPassword};";
                    cn = new SqlConnection { ConnectionString = ConnectionString };
    
                    {
                        try
                        {
                            cn.Open();
                            if (cn.State == ConnectionState.Open)
                            {
                                MessageBox.Show("connection succeeded!");
                            }
                            return true;
                        }
                        
    
                        catch (Exception e)
                        {
                          
                            return false;
                        }
                    }
                }
                
            }
            private void checkBox1_CheckedChanged(object sender, EventArgs e)
            {
                if (checkBox1.Checked)
                {
                    txtpassword.UseSystemPasswordChar = true;
                }
                else
                {
                    txtpassword.UseSystemPasswordChar = false;
                }
    
    
            }
        }
    }

    Thursday, October 3, 2019 11:26 AM
  • Thursday, October 3, 2019 11:27 AM
  • I made a extremely simple code sample which is downloadable here.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, October 3, 2019 11:37 AM
    Moderator
  • I made a extremely simple code sample which is downloadable here.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thank you, but there are code for connection to sql database(and it's complicated for me), I need code for creating table in sql database
    Thursday, October 3, 2019 12:25 PM
  • It's complicated at this time but if you take quality time to learn from the code then it will be super easy.

    In regards to creating a table, the class below is a modified version of the class in the .zip file I placed on OneDrive. If the table does not exists, create it, if the table exists, create the table.

    using System;
    using System.Data.SqlClient;
    using System.Security;
    
    namespace MinimalApproachExample
    {
        public class DatabaseUser
        {
            private string serverName;
            private string catalogName;
            public DatabaseUser(string pServerName, string pCatalogName)
            {
                serverName = pServerName;
                catalogName = pCatalogName;
            }
            public bool SqlCredentialLogin(string pUserNName, string pPassword)
            {
    
                string connectionString = $"Data Source={serverName};" +
                                          $"Initial Catalog={catalogName};";
    
    
                var securePassword = new SecureString();
    
                foreach (var character in pPassword)
                {
                    securePassword.AppendChar(character);
                }
    
                securePassword.MakeReadOnly();
    
                var credentials = new SqlCredential(pUserNName, securePassword);
    
                using (var cn = new SqlConnection { ConnectionString = connectionString })
                {
                    try
                    {
                        cn.Credential = credentials;
                        cn.Open();
                        return true;
    
                    }
                    catch (Exception)
                    {
                        return false;
                    }
                }
            }
            public string DoWork(string pUserNName, string pPassword)
            {
    
                string connectionString = $"Data Source={serverName};" +
                                          $"Initial Catalog={catalogName};";
    
    
                var securePassword = new SecureString();
    
                foreach (var character in pPassword)
                {
                    securePassword.AppendChar(character);
                }
    
                securePassword.MakeReadOnly();
    
                var credentials = new SqlCredential(pUserNName, securePassword);
    
                using (var cn = new SqlConnection { ConnectionString = connectionString })
                {
                    using (var cmd = new SqlCommand { Connection = cn })
                    {
                        try
                        {
                            // Table name to create
                            var tableName = "Person";
    
                            cmd.CommandText = "SELECT CASE WHEN exists((SELECT * FROM information_schema.tables " + 
                                              $"WHERE table_name = '{tableName}')) THEN 1 ELSE 0 END;";
                            cn.Credential = credentials;
                            cn.Open();
    
                            // check to see if table currently exists, if not create the table
                            var exists = (int)cmd.ExecuteScalar() == 1;
    
                            if (exists == false)
                            {
                                cmd.CommandText ="CREATE TABLE Person (PersonIdentifier INT PRIMARY KEY," +
                                                 "FirstName VARCHAR(50) NOT NULL," +
                                                 "LastName VARCHAR(50) NOT NULL);";
    
                                cmd.ExecuteNonQuery();
                            }
    
                            return "";
                        }
                        catch (Exception e)
                        {
                            return e.Message;
                        }
                    }
                }
    
    
            }
        }
    }
    


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, October 3, 2019 1:35 PM
    Moderator
  • Where must I write my server name, my login and password? And where are buttons, textboxes, checkbox?
    Friday, October 4, 2019 7:09 AM
  • Where must I write my server name, my login and password? And where are buttons, textboxes, checkbox?

    Hi pavlob,

    It depends on your connection string, you could sql connection string for reference.

    https://www.connectionstrings.com/sql-server/

    https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax

    The controls buttons, textboxes, checkbox are defined by yourself.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Decompressor Friday, November 15, 2019 8:59 AM
    Wednesday, October 16, 2019 6:02 AM
    Moderator