bool allGood = false; |
do |
{ |
LoginWindow loginWindow = new LoginWindow(); |
loginWindow.ShowDialog(); |
if (loginWindow.DialogResult.GetValueOrDefault(false)) |
{ |
try |
{ |
// Try and do something... |
allGood = true; |
} |
catch (Exception) |
{ |
lastLoginFailed = true; |
} |
} |
else |
return; |
} while (!allGood); |
InvalidCastException |
Unable to cast object of type 'System.Windows.Style' to type 'System.Collections.Generic.IList'1[System.Windows.Style] |
WPF and C#: Problem: 1. How to Refresh Radgridview when i Insert,update and Delete Record in database anrecord. 2.when i am Insert or Update Record than in radgridview that row is selected.
i am useing sql server 2005.
i am use to set data source of radgridview like " radgridview1.ItemsSource = ds; " ==> ds is dataset.
i am beginner so if possible than tel me by code it is easy to understand.......
can u help me as early as possible ....
i give some code which i am useing for update RadGridview
con.ConnectionString = @"Data Source=(local);Initial Catalog=DigiDms;Integrated Security=True"; |
cmd1.Connection = con; |
con.Open(); |
cmd1.CommandType = CommandType.StoredProcedure; |
cmd1.CommandText = "Pro_Insurance_Master_Select"; |
da1.SelectCommand = cmd1; |
da1.Fill(ds1); |
con.Close(); |
//dataGrid.clear(); |
//dsGrid.Reset(); |
//dsGrid = dataGrid.GetData("Pro_Insurance_Master_Select"); //set datasource of gridview |
gridShowData.ItemsSource = null; // At hear i get Error |
gridShowData.ItemsSource = ds1; |
doing this ,
when i am delete or update record than folloning error generated...
Error: >> "Object reference not set to an object"
when i am doing the "gridShowData.ItemsSource = null;"
and when i am doing insert operation than this error is not generated and RadGridview also updated.....
so pls help me as early as possible.... i am beginer ........