CRUD Operations in WPF With MVVM Framework: Home All Articles SQL Server Interview Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

CodeSolution.

org
Your Problems Our Solutions

HOME ALL ARTICLES .NET CORE SQL SERVER INTERVIEW QUESTIONS    

CRUD Operations in WPF with MVVM Framework META

Log in
   Entries feed
Comments feed

This Tutorial will explain how to implement crud operations in WPF with MVVM Framework. WordPress.org

Open Visual Studio 2012. Go to create new project tab. Select WPF Application.
MY FAVOURITES
Add Five folders to the Application.

Model
View
ViewModel
Data
Helpers

Samsung JBL Clip 3 by


Galaxy M31... Harman...
INR 2,699.00

Shop now Shop now

Employee Data

Design the Data Grid in WPF HP 15 Intel boAt Bassheads


Pentium Gold... 242 in Ear...
Create a MainWindow.xaml le inside View folder in your appliction. Add the below code to
INR 27,904.00 INR 549.00
the le.
Shop now Shop now
1 <Grid Margin="0,0,0,-1">
2         <Grid.RowDefinitions>
3             <RowDefinition Height="0.939*"/>
4             <RowDefinition Height="Auto"/>
5         </Grid.RowDefinitions> CATEGORIES
6         <GroupBox Header="Employee Data" HorizontalAlignment="Center
7             <Grid>
8                 <Grid.RowDefinitions>
Asp.Net (43)
9                     <RowDefinition />
10                     <RowDefinition Height="Auto"/> Asp.Net Core (3)
11                 </Grid.RowDefinitions>
12                 <ScrollViewer VerticalScrollBarVisibility="Auto" Mar Asp.Net MVC (5)
13                     <StackPanel> Asp.Net Rest API (2)
14                         <StackPanel Orientation="Horizontal" Margin=
15                             <DataGrid x:Name="dg1" ItemsSource="{Bin ASP.Net Web API (4)
16                                 <DataGrid.Columns>
C# (45)
17                                     <DataGridTextColumn Header="Emp
18                                     <DataGridTextColumn Header="Firs Entity Framework (1)
19                                     <DataGridTextColumn Header="Last
20                                     <DataGridTextColumn Header="DOB" HTML5 (6)
21                                     <DataGridTextColumn Header="Gend Canvas (5)
22                                     <DataGridTextColumn Header="Nati
23                                     <DataGridTextColumn Header="Lang Interview Questions (178)
24                                     <DataGridTextColumn Header="Addr
Asp.Net (10)
25                                 </DataGrid.Columns>
26                             </DataGrid> Asp.Net MVC (32)
27                         </StackPanel>
28                     </StackPanel> Asp.Net Web API (1)
29                 </ScrollViewer> C# (30)
30                 <Button Grid.Row="1" Content="Add Employee" Command=
31             </Grid> Entity framework (15)
32         </GroupBox>
JAVA (7)
33     </Grid>
LINQ (6)
Create a User.cs class inside Model folder in your Application. Write the below code in the SQL Server (30)
le. WCF (12)
WPF (40)
1 class User : INotifyPropertyChanged
2 { JAVA (32)
3     private string _id; Design Pattern (3)
4     private string _firstName;
5     private string _address; Hibernate (3)
6     private string _lastName;
7     private string _language; Spring Tutorial (2)
8     private string _dob; JavaScript (3)
9     private string _nationality;
10     private string _gender; Jquery (5)
11     private bool _male;
Linux (7)
12     private bool _female;
13     private bool _hindi; Logical Problems (10)
14     private bool _english;
15     private bool _french; My SQL (5)
16   PHP (1)
17     public User()
18     { Spring (3)
19     }
SQL Server (38)
20  
21     public string ID Uncategorized (1)
22     {
23         get { return _id; } Web Service (2)
24         set Wicket Framework (2)
25         {
26             _id = value; WPF (1)
27             NotifyOfPropertyChange("ID");
XML (1)
28         }
29     }
30     public string FirstName
31     {
32         get { return _firstName; } RECENT POSTS
33         set
34         {
35             _firstName = value;
Global exception handling in asp.net core
36             NotifyOfPropertyChange("FirstName");
37         } TempData is null in asp.net core
38     }
39     public string LastName How to disable camel case in asp.net
40     { core?
41         get { return _lastName; }
42         set Delete, Backspace, Tab and Arrow keys
43         {
are not working in Firefox when applying
44             _lastName = value;
45             NotifyOfPropertyChange("LastName"); validation.
46         }
47     } How to encode URI components in
48     public string Address javascript?
49     {
50         get { return _address; }
51         set
52         {
53             _address = value; QUICK LINKS
54             NotifyOfPropertyChange("Address");
55         }
56     } ALL ARTICLES
57  
58     public string Language INTERVIEW QUESTIONS
59     {
C# LOGICAL QUESTIONS
60         get { return _language; }
61         set FOLLOW
62         {
63             _language = string.Empty; CONTACT US
64             string Comma = string.Empty;
65             if (Hindi)
66             {
67                 _language = "Hindi"; COMMUNITIES & GROUPS
68             }
69             if (English)
70             {
71                 if (!string.IsNullOrEmpty(_language)) Facebook Group
72                 {
73                     Comma = ",";
74                 }
75                 _language = _language + Comma + "English"; FOLLOW US ON SOCIAL NETWORK
76             }
77             if (French)
78             {
79                 if (!string.IsNullOrEmpty(_language))
80                 {   
81                     Comma = ",";
82                 }
83                 _language = _language + Comma + "French";
84             }
85             NotifyOfPropertyChange("Language");
86         }
87     }
88  
89     public string DOB
90     {
91         get { return _dob; }
92         set
93         {
94             _dob = Convert.ToDateTime(value).ToString("MM/dd/yyyy")
95             NotifyOfPropertyChange("DOB");
96         }
97     }
98  
99     public string Nationality
100     {
101         get { return _nationality; }
102         set
103         {
104             _nationality = value;
105             NotifyOfPropertyChange("Nationality");
106         }
107     }
108  
109     public bool Male
110     {
111         get { return _male; }
112         set
113         {
114             _male = value;
115             Gender = "Male";
116             NotifyOfPropertyChange("Male");
117         }
118     }
119  
120     public bool Female
121     {
122         get { return _female; }
123         set
124         {
125             _female = value;
126             Gender = "Female";
127             NotifyOfPropertyChange("Female");
128         }
129     }
130     public string Gender
131     {
132         get { return _gender; }
133         set
134         {
135             if (Male)
136             {
137                 _gender = "Male";
138             }
139             if (Female)
140             {
141                 _gender = "Female";
142             }
143  
144             NotifyOfPropertyChange("Gender");
145         }
146     }
147  
148     public bool Hindi
149     {
150         get { return _hindi; }
151         set
152         {
153             _hindi = value;
154             Language = "Hindi";
155             NotifyOfPropertyChange("Hindi");
156         }
157     }
158  
159     public bool English
160     {
161         get { return _english; }
162         set
163         {
164             _english = value;
165             Language = "English";
166             NotifyOfPropertyChange("English");
167         }
168     }
169  
170     public bool French
171     {
172         get { return _french; }
173         set
174         {
175             _french = value;
176             Language = "French";
177             NotifyOfPropertyChange("French");
178         }
179     }
180  
181     #region INotifyPropertyChanged Members
182     public event PropertyChangedEventHandler PropertyChanged;
183  
184     private void NotifyOfPropertyChange(string propertyName)
185     {
186         if (PropertyChanged != null)
187         {
188             PropertyChanged(this, new PropertyChangedEventArgs(prop
189         }
190     }
191     #endregion
192 }

Bind this data grid to ViewModelUser. Write the below code to MainWindow.xaml.cs le.

1 this.DataContext = new ViewModelUser();

Create a ViewModelUser.cs class inside ViewModel folder in your application. Add the below
code to this class le.

1 PersonnelBusinessObject personnel;
2 ObservableCollection<User> _Employee;
3 public ViewModelUser()
4   {
5      personnel = new PersonnelBusinessObject();
6   }
7 public ObservableCollection<User> Employee
8   {
9      get
10        {
11           _Employee = new ObservableCollection<User>(personnel.GetEm
12           return _Employee;
13        }
14   }

PersonnelBusinessObject Class is used to write business logic. Create a


PersonnelBusinessObject.cs in Model folder of your application.

1 class PersonnelBusinessObject
2    {
3        List<User> Employee { get; set; }
4        public PersonnelBusinessObject()
5        {
6            Employee = DatabaseLayer.GetEmployeeFromDatabase();
7        }
8  
9        public List<User> GetEmployees()
10        {
11            return Employee = DatabaseLayer.GetEmployeeFromDatabase()
12        }
13    }

DatabaseLayer class is used to communicate with database. you can write your stored
procedure and queries to fetch data from database.
Create a DatabaseLayer.cs class in Data Folder in your application. Write the below code in
this class.

1 class DatabaseLayer
2 {
3     public static List<User> GetEmployeeFromDatabase()
4     {
5         try
6         {
7             DataTable dt = SqlHelper.ExecuteDataTable(AppConstants.g
8             var Employee = new List<User>();
9             foreach (DataRow row in dt.Rows)
10             {
11                 var obj = new User()
12                 {
13                     ID = (string)row["ID"],
14                     FirstName = (string)row["FirstName"],
15                     LastName = (string)row["LastName"],
16                     DOB = (string)row["DOB"],
17                     Gender = (string)row["Gender"],
18                     Nationality = (string)row["Nationality"],
19                     Language = ((string)row["Language"]),
20                     Address = (string)row["Address"],
21                     Male = (bool)row["Male"],
22                     Female = (bool)row["Female"],
23                     Hindi = (bool)row["Hindi"],
24                     English = (bool)row["English"],
25                     French = (bool)row["French"],
26                 };
27                 Employee.Add(obj);
28             }
29             return Employee;
30         }
31         catch (Exception ex)
32         {
33             throw ex;
34         }
35     }
36 }

After building and running the application data will be populate in the Data grid.
Implementing Insert, Update and Delete operations in WPF with MVVM Framework.

Employee Form

Open the MainWindow.xaml le and add the below code just above to the existing code.

1 <Window.Resources>
2         <!-- This converts SelectedItem to a collection, for use in
3         <helpers:SelectedItemToItemsSource x:Key="SelectedItemToItem
4  
5         <!-- This is the template for the user form, used by the ite
6         <DataTemplate x:Key="UserGrid">
7             <Border Background="Chocolate" BorderBrush="Black" Borde
8                 <Grid Margin="10">
9                     <Grid.RowDefinitions>
10                         <RowDefinition/>
11                         <RowDefinition/>
12                         <RowDefinition/>
13                         <RowDefinition/>
14                         <RowDefinition/>
15                         <RowDefinition/>
16                         <RowDefinition/>
17                         <RowDefinition/>
18                         <RowDefinition/>
19                         <RowDefinition/>
20                         <RowDefinition/>
21                     </Grid.RowDefinitions>
22                     <Grid.ColumnDefinitions>
23                         <ColumnDefinition/>
24                         <ColumnDefinition/>
25                     </Grid.ColumnDefinitions>
26                     <TextBlock Text="Emp ID" Grid.Row="1" Grid.Colum
27                     <TextBlock Text="First Name" Grid.Row="2" Grid.C
28                     <TextBlock Text="Last Name" Grid.Row="3" Grid.Co
29                     <TextBlock Text="Address" Grid.Row="4" Grid.Colu
30                     <TextBlock Text="Gender" Grid.Row="5" Grid.Colum
31                     <TextBlock Text="Language" Grid.Row="6" Grid.Col
32                     <TextBlock Text="Nationality" Grid.Row="7" Grid.
33                     <TextBlock Text="DOB" Grid.Row="8" Grid.Column="
34                     <TextBox Text="{Binding ID, BindingGroupName=Gro
35                     <TextBox Text="{Binding FirstName, BindingGroupN
36                     <TextBox Text="{Binding LastName, BindingGroupNa
37                     <TextBox Text="{Binding Address, BindingGroupNam
38                     <StackPanel Orientation="Horizontal"  Grid.Colum
39                         <RadioButton Name="radMale" GroupName="Gende
40                         <RadioButton Name="radFemale" GroupName="Gen
41                     </StackPanel>
42                     <StackPanel Orientation="Horizontal"  Grid.Colum
43                         <CheckBox IsChecked="{Binding Hindi, Binding
44                         <CheckBox IsChecked="{Binding English, Bindi
45                         <CheckBox IsChecked="{Binding French, Bindin
46                     </StackPanel>
47                     <ComboBox DisplayMemberPath="Nationality" Select
48                     <DatePicker x:Name="dpDOB" Grid.Column="1" Grid.
49                                SelectedDateFormat="Short"  SelectedD
50                     <StackPanel Orientation="Horizontal" Grid.Row="1
51                         <Button Foreground="White" Background="Green
52                         <Button Foreground="White" Background="Green
53                         <Button Foreground="White" Background="Green
54                     </StackPanel>
55                 </Grid>
56             </Border>
57         </DataTemplate>
58     </Window.Resources>

Add the below line of code just after the Data Grid.

1 <ItemsControl BindingGroup="{Binding UpdateBindingGroup, Mode=OneWay}

Helper class is used to converts SelectedItem to a collection, for use in the ItemsControl.
Add the Helper class reference to the MainWindow.xaml.

1 xmlns:helpers="clr-namespace:WpfCrudeOperations.Helpers"

Create a Converters.cs class in the Helpers folder and add the below line of code in the class
le

1 public class SelectedItemToItemsSource : IValueConverter


2    {
3        public object Convert(object value, Type targetType, object p
4        {
5            if (value == null) return null;
6            return new List<object>() { value };
7        }
8  
9        public object ConvertBack(object value, Type targetType, obje
10        {
11            throw new NotImplementedException();
12        }
13    }

ViewModelUser uses a ViewModelBase.cs class to implement INotifyPropertyChanged event.


Create a ViewModelBase.cs class inside ViewModel folder in your application.

1 class ViewModelBase : INotifyPropertyChanged


2    {
3        //basic ViewModelBase
4        internal void RaisePropertyChanged(string prop)
5        {
6            if (PropertyChanged != null) { PropertyChanged(this, new
7        }
8        public event PropertyChangedEventHandler PropertyChanged;
9  
10        //Extra Stuff, shows why a base ViewModel is useful
11        bool? _CloseWindowFlag;
12        public bool? CloseWindowFlag
13        {
14            get { return _CloseWindowFlag; }
15            set
16            {
17                _CloseWindowFlag = value;
18                RaisePropertyChanged("CloseWindowFlag");
19            }
20        }
21  
22        public virtual void CloseWindow(bool? result = true)
23        {
24            Application.Current.Dispatcher.BeginInvoke(DispatcherPrio
25            {
26                CloseWindowFlag = CloseWindowFlag == null
27                    ? true
28                    : !CloseWindowFlag;
29            }));
30        }
31    }

Buttons “Add Employee”, “Save”, “Cancel” and “Delete” uses Relay command to communicate
with ViewModel.
Add the below line of code in ViewModelUser.cs class.

1 public RelayCommand CancelCommand { get; set; }


2 public RelayCommand SaveCommand { get; set; }
3 public RelayCommand AddUserCommand { get; set; }
4 public RelayCommand DeleteUserCommand { get; set; }

To call these commands we have to declared methods for these commands on


ViewModelUser constructor.

1 CancelCommand = new RelayCommand(DoCancel);


2 SaveCommand = new RelayCommand(DoSave);
3 AddUserCommand = new RelayCommand(AddUser);
4 DeleteUserCommand = new RelayCommand(DeleteUser);

De ne methods

1 void DoCancel(object param)


2 {
3     UpdateBindingGroup.CancelEdit();
4     if (SelectedIndex == -1)    //This only closes if new - just to
5         SelectedEmployee = null;
6 }
7  
8 void DoSave(object param)
9 {
10     UpdateBindingGroup.CommitEdit();
11     var employee = SelectedEmployee as User;
12     if (SelectedIndex == -1)
13     {
14         personnel.AddEmployee(employee);
15         RaisePropertyChanged("Employee"); // Update the list from th
16     }
17     else
18         personnel.UpdateEmployee(employee);
19  
20     SelectedEmployee = null;
21 }
22  
23 void AddUser(object parameter)
24 {
25     SelectedEmployee = null; // Unselects last selection. Essential,
26     var employee = new User();
27     SelectedEmployee = employee;
28 }
29  
30 void DeleteUser(object parameter)
31 {
32     var employee = SelectedEmployee as User;
33     if (SelectedIndex != -1)
34     {
35         personnel.DeleteEmployee(employee);
36         RaisePropertyChanged("Employee"); // Update the list from th
37     }
38     else
39         SelectedEmployee = null; // Simply discard the new object
40 }

Add RelayCommand.cs class le in ViewModel Folder in your application.

1 class RelayCommand : ICommand


2 {
3     #region Fields
4  
5     readonly Action<object> _execute;
6     readonly Predicate<object> _canExecute;
7  
8     #endregion // Fields
9  
10     #region Constructors
11  
12     public RelayCommand(Action<object> execute)
13         : this(execute, null)
14     {
15     }
16  
17     public RelayCommand(Action<object> execute, Predicate<object> ca
18     {
19         if (execute == null)
20             throw new ArgumentNullException("execute");
21  
22         _execute = execute;
23         _canExecute = canExecute;
24     }
25     #endregion // Constructors
26  
27     #region ICommand Members
28  
29     public bool CanExecute(object parameter)
30     {
31         return _canExecute == null ? true : _canExecute(parameter);
32     }
33  
34     public event EventHandler CanExecuteChanged
35     {
36         add { CommandManager.RequerySuggested += value; }
37         remove { CommandManager.RequerySuggested -= value; }
38     }
39  
40     public void Execute(object parameter)
41     {
42         _execute(parameter);
43     }
44  
45     #endregion // ICommand Members
46 }

To Populate Nationality ComboBox. Write the below code in ViewModelUser.cs class.

1 public ObservableCollection<NationalityCollection> NationalityList


2    {
3       get
4         {
5             _nationalityCollection = new ObservableCollection<Nationa
6              return _nationalityCollection;
7         }
8    }

Add a new class NationalityCollection.cs in Model folder to get Nationality collection.

1 class NationalityCollection : INotifyPropertyChanged


2 {
3     ICollectionView _nationalityCollection;
4     public ICollectionView NationalityView
5     {
6         get { return _nationalityCollection; }
7         set
8         {
9             if (value != _nationalityCollection)
10             {
11                 _nationalityCollection = value;
12                 NotifyOfPropertyChange("NationalityCollection");
13             }
14         }
15     }
16  
17     public string Nationality
18     {
19         get { return _nationality; }
20         set
21         {
22             _nationality = value;
23             NotifyOfPropertyChange("Nationality");
24         }
25     }
26  
27     #region INotifyPropertyChanged Members
28     public event PropertyChangedEventHandler PropertyChanged;
29     private string _nationality;
30  
31     private void NotifyOfPropertyChange(string propertyName)
32     {
33         if (PropertyChanged != null)
34         {
35             PropertyChanged(this, new PropertyChangedEventArgs(prope
36         }
37     }
38     #endregion
39 }
Add below methods in the PersonnelBusinessObject.cs class

1 List<NationalityCollection> NationalityCollection { get; set; }


2 public List<NationalityCollection> GetNationality()
3 {
4     return NationalityCollection = DatabaseLayer.GetNationality();
5 }
6 public void AddEmployee(User employee)
7 {
8     DatabaseLayer.InsertEmployee(employee);
9     OnEmployeeChanged();
10 }
11  
12 public void UpdateEmployee(User employee)
13 {
14     DatabaseLayer.UpdateEmployee(employee);
15     OnEmployeeChanged();
16 }
17  
18 public void DeleteEmployee(User employee)
19 {
20     DatabaseLayer.DeleteEmployee(employee);
21     OnEmployeeChanged();
22 }
23  
24 void OnEmployeeChanged()
25 {
26     if (EmployeeChanged != null)
27         EmployeeChanged(this, null);
28 }

Add below methods in DatabaseLayer.cs class

1 internal static void InsertEmployee(User employee)


2 {
3     try
4     {
5         SqlParameter[] MyParams = new SqlParameter[8];
6         MyParams[0] = new SqlParameter("@ID", employee.ID);
7         MyParams[1] = new SqlParameter("@FirstName", employee.FirstN
8         MyParams[2] = new SqlParameter("@LastName", employee.LastNam
9         MyParams[3] = new SqlParameter("@Gender", employee.Gender);
10         MyParams[4] = new SqlParameter("@DOB", employee.DOB);
11         MyParams[5] = new SqlParameter("@Language", employee.Languag
12         MyParams[6] = new SqlParameter("@Nationality", employee.Nati
13         MyParams[7] = new SqlParameter("@Address", employee.Address)
14         SqlHelper.ExecuteNonQuery(AppConstants.getConnectionString()
15         MessageBox.Show("Data Saved Successfully.");
16     }
17     catch (SqlException ex)
18     {
19         throw ex;
20     }
21     finally
22     {
23  
24     }
25 }
26  
27 internal static void UpdateEmployee(User employee)
28 {
29     try
30     {
31         SqlParameter[] MyParams = new SqlParameter[8];
32         MyParams[0] = new SqlParameter("@ID", employee.ID);
33         MyParams[1] = new SqlParameter("@FirstName", employee.FirstN
34         MyParams[2] = new SqlParameter("@LastName", employee.LastNam
35         MyParams[3] = new SqlParameter("@Gender", employee.Gender);
36         MyParams[4] = new SqlParameter("@DOB", employee.DOB);
37         MyParams[5] = new SqlParameter("@Language", employee.Languag
38         MyParams[6] = new SqlParameter("@Nationality", employee.Nati
39         MyParams[7] = new SqlParameter("@Address", employee.Address)
40         SqlHelper.ExecuteNonQuery(AppConstants.getConnectionString()
41         MessageBox.Show("Data Updated Successfully.");
42     }
43     catch (SqlException ex)
44     {
45         throw ex;
46     }
47     finally
48     {
49  
50     }
51 }
52  
53 internal static void DeleteEmployee(User employee)
54 {
55     try
56     {
57         SqlParameter[] MyParams = new SqlParameter[1];
58         MyParams[0] = new SqlParameter("@ID", employee.ID);
59         SqlHelper.ExecuteNonQuery(AppConstants.getConnectionString()
60         MessageBox.Show("Data Deleted Successfully.");
61     }
62     catch (SqlException ex)
63     {
64         throw ex;
65     }
66     finally
67     {
68  
69     }
70 }
71 public static List<NationalityCollection> GetNationality()
72 {
73     try
74     {
75         DataTable dt = SqlHelper.ExecuteDataTable(AppConstants.getCo
76         var NationalityList = new List<NationalityCollection>();
77         foreach (DataRow row in dt.Rows)
78         {
79             var obj = new NationalityCollection()
80             {
81                 Nationality = (string)row["Nationality"]
82             };
83             NationalityList.Add(obj);
84         }
85         return NationalityList;
86         // return dt;
87     }
88     catch (Exception ex)
89     {
90         throw ex;
91     }
92 }

To Implement employee change event. add these line of code in ViewModelUser class
constructor.

1 personnel.EmployeeChanged += new EventHandler(personnel_EmployeeChang


2 UpdateBindingGroup = new BindingGroup { Name = "Group1" };

Method “personnel_EmployeeChanged” de nition.

1 void personnel_EmployeeChanged(object sender, EventArgs e)


2     {
3         Application.Current.Dispatcher.BeginInvoke(DispatcherPriority
4          {
5              RaisePropertyChanged("Employee");
6          }));
7     }

1 BindingGroup _UpdateBindingGroup;
2 public BindingGroup UpdateBindingGroup
3 {
4     get
5     {
6         return _UpdateBindingGroup;
7     }
8     set
9     {
10         if (_UpdateBindingGroup != value)
11         {
12             _UpdateBindingGroup = value;
13             RaisePropertyChanged("UpdateBindingGroup");
14         }
15     }
16 }

To get the selected employee from the data grid. Add the below code in ViewModelUser
class.

1 public int SelectedIndex { get; set; }


2 object _SelectedEmployee;
3 public object SelectedEmployee
4 {
5     get
6     {
7         return _SelectedEmployee;
8     }
9     set
10     {
11         if (_SelectedEmployee != value)
12         {
13             _SelectedEmployee = value;
14             RaisePropertyChanged("SelectedEmployee");
15         }
16     }
17 }

SQL Helper Class


http://www.codesolution.org/sql-helper-class-in-asp-net/

After building and running the application result will be as.

Employee View

  

Related Posts:
1. Immutable Objects in java
2. CRUD Operations using ASP.NET Web API.
3. Asp.Net MVC CRUD Operations
4. CRUD Operations using WCF Rest API

This entry was posted in WPF and tagged Calender in WPF with MVVM, CheckBox in WPF with MVVM,
ComboBox in WPF with WVVM, Crud Operations in WPF, crud operations in wpf datagrid, Crud
Operations in WPF with MVVM Framework, delete in wpf with mvvm, Insert in wpf with mvvm,
RadioButton in WPF with MVVM., Select and Insert and Update and Delete in WPF, update in wpf with
mvvm, WPF Crud, wpf crud example, WPF Crud Operations, WPF Crud Sample, WPF Crud Tutorial on
January 28, 2015 by Hitesh Kumar.
About Hitesh Kumar
A Software Developer with more than 5+ years of rich experience in Software
Development in Microsoft Dot Net Technology.
View all posts by Hitesh Kumar →

← LinkedList over ArrayList Explain the di erence between static and


dynamic resource? →

35 thoughts on “CRUD Operations in WPF with MVVM Framework”

neha
January 29, 2015 at 12:44 AM

In very Simple Way You discuss the WPF, It helps to build my rst WPF application.

javed
March 16, 2015 at 5:07 AM

Very Helpfull…………
Thanks For Sharing

Sunil
April 7, 2015 at 1:41 AM

Hi Sir,

very nice article, Please could you send me the source code of all, I am trying the above code
in my system but. I am not able to do it.
Please send me at [email protected]

Vineet
May 20, 2015 at 4:43 AM

could you please send me the source code of this example.

Zalak Shah
July 18, 2016 at 1:42 AM

can you please mail this source code on my email address?


[email protected]

mahendra
November 30, 2015 at 11:56 PM

very nice article ,i have tried it but not able to implement it on my system,can you please
send whole source code on above mentioned email address

rajon
December 13, 2015 at 11:56 PM
how impliment EmployeeChanged method?please send me source code .
My email is [email protected]

sonali
May 29, 2016 at 1:02 PM

plz send me source code @ [email protected]

Rajon
December 14, 2015 at 11:51 PM

please send me source code.It is very helpful article.

jyoti
December 28, 2015 at 5:40 AM

The article is very useful. I am implementing the code but at some places I m facing
problems. I would be grateful to you if you could send me the source code.

jyoti
December 28, 2015 at 6:36 AM

Pls send the source code on my email [email protected].

Nitin Patel
January 6, 2016 at 6:54 AM

Useful Article, can you please send SqlHelper class on [email protected]

Hitesh
January 7, 2016 at 3:45 AM

SQL Helper Class


http://www.codesolution.org/sql-helper-class-in-asp-net/

Nitin Patel
January 6, 2016 at 6:55 AM

super Article, can you please send SqlHelper class on [email protected]

Mouhssine CHOUKI
February 24, 2016 at 8:13 AM

Useful Article, can you please send source code on [email protected]

Sheebu
March 3, 2016 at 1:59 AM
can you send sqlhelper class on this address : [email protected]

vijay
March 3, 2016 at 6:25 AM

Nice article ! could you send me source code @ [email protected]

Renato
March 3, 2016 at 9:41 PM

Its very good article. You can send the code to my email [email protected]

Fern Mart
April 7, 2016 at 10:59 AM

i would like to see source code for comparison as i am having issues

NK Kaushik
April 26, 2016 at 12:54 AM

there is no mention anywhere about code of stored procedures


script for creating SP must be provided

NK Kaushik
April 26, 2016 at 6:15 AM

Nice article ! could you send me SCRIPT FOR stored procedure & table creation at thanks
[email protected]

Dnyanesh
May 10, 2016 at 9:48 AM

Nice article THANKS ! could you send me source code @ [email protected]

sonali
May 29, 2016 at 1:03 PM

could you send me source code @ [email protected]

Abdelhak tou
June 14, 2016 at 8:27 AM

It’s very clear and usefull , thanks!!!!


Could you please send me the code to compare what i ve done and to correct some issues ,at
[email protected]
cheers;

tedwu
July 4, 2016 at 9:59 PM
very userfull for me!

could you please send source code , thank you

[email protected]

Zalak Shah
July 18, 2016 at 1:44 AM

I want to show source code, can you please mail me the source code?
my email id is [email protected]
Thanks.

kiran
July 18, 2016 at 8:28 PM

please send me the full source code,thank you

kiran
July 19, 2016 at 3:58 AM

Nice article THANKS ! could you send me full source code @ [email protected]

Joe
July 28, 2016 at 9:21 PM

Nice Article please send me the full source code

Harish
August 6, 2016 at 6:31 AM

Dear I am getting Error on AppConstants in DataBaseLayer.cs le

Hitesh Kumar Post author

August 26, 2016 at 9:24 PM

AppConstants le contains only connection to database. You can simply add your
connection string.

Rahul
August 30, 2016 at 4:28 AM

It’s very clear and usefull , thanks!!!!


Could you please send me the code to compare what i ve done and to correct some issues ,at
[email protected]

legion
October 17, 2016 at 5:42 PM

Hi ,
Thanks for the great tutorial! Could it be possible to send me also the source code to
compare with mine?
Regards,
[email protected]

Rajendra valekar
October 27, 2016 at 6:20 AM

Thanks,very nice article for start wpf .


sir please send me source code or sql stored procedure and table code on
gmail: [email protected]

Govind Tupkar
November 10, 2016 at 3:15 AM

Nice article, could u send me the source code @[email protected]

Comments are closed.

Proudly powered by WordPress

You might also like