• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 782
  • Last Modified:

WPF C# string formatting for textbox

Hi Experts,

I have a WPF application with a WPF window with a textbox called


Right now the user enters a string into the textbox and then that string is converted to an integer before it's stored into the sql server database.

I am changing this textbox to have a user enter a value that is stored as varchar(50) datatype in sql server.

Below is the snippet that parses the textbox and converts the string entered to an integer.

Does anyone know how to change this snippet so instead of converting the string that is entered to an integer it changes it to:   varchar(50)  

The key part of the snippet is:     Int32.Parse

I tried to change that to:               string  

But that doesnt work.

Can anyone please help?
private List<Case> GetCaseList()
            List<Case> empList = null;
            AccessCases emp = new AccessCases();

            //converts the string representation of a number in a specificied style to
            //its 32bit signed integer equivalent
            empList = emp.GetCases(Int32.Parse(textBox1.Text));
            return empList;

Open in new window

1 Solution

empList = emp.GetCases(Int32.Parse(textBox1.Text)).ToList();

Question: AccessCases is some standard class? Do you have sources for it? If so, can you send as AccesCases class with method: GetCases ?

Open in new window


Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now