[stackoverflow] [progress Openedge Abl] Wpf Form Freezing Up

Status
Not open for further replies.
D

DaveMcGaha

Guest
Ok - I have finally got my connection string and sql string correct in this WPF form. I kept getting reader exceptions until I finally got the sql string the correct way, so since I am not getting errors now - I am assuming it is correct. Have inserted a breakpoint at IDbCommand and stepped through, and all steps seem to go fine. But the program locks up and does not display any data in the datagrid. Cannot even click on the form once all statements are processed. What have I missed here? This is a Progress OpenEdge DB - and this is the recommended connection and command from Progress.

private void MonReadButton_Click(object sender, RoutedEventArgs e)
{

var estNum = EstTextBox.Text;
{
string connectString = "DSN=****;uid=**;pwd=*****;host=****;port=****;db=****;";
using (OdbcConnection dbConn = new OdbcConnection(connectString))
{
try
{
dbConn.Open();

}
catch (Exception)
{
MessageBox.Show("connection failed");
}





IDbCommand dbcmd = dbConn.CreateCommand();
string sqlstr = @"SELECT ""Estimate"".""Labor-Cost"" FROM ""GAMS1"".""PUB"".""Estimate"" WHERE ""Estimate"".""Estimate-ID""=" + estNum;

dbcmd.CommandText = sqlstr;
IDataReader reader = dbcmd.ExecuteReader();
while (reader.Read())
{
DataTable dt = new DataTable();
dt.Load(reader);
DataGrid1.ItemsSource = dt.DefaultView;
}
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbConn.Close();

}

}
}

Continue reading...
 
Status
Not open for further replies.
Top