Thank you, but I have a window application and the DataFormattingExpression property isn't exist. finally I found a tutorial here, at: http://www.thecodeproject.com/csharp/Apply_DataGridTableStyle.asp[^]
Thank you everybody. Finally I found a way to do what I want. I read the connectionString as a text file.:-O using (StreamReader sr = new StreamReader("c://WINNT//myConnection.udl")) { string line; //--the connection string is define at the third line of the file line = sr.ReadLine(); line = sr.ReadLine(); line = sr.ReadLine(); connectionString = line; }