D
Diego Armando Maradona
Hello,
I have a DEVEXPRESS grid on my form
When I try to load data into the form,
If row count is huge (this example : 45000 row is returned, column count =~
10)
This line waits for a long time to load data into grid
grdMats.DataMember = "MATS"; // THIS LINE WAITS FOR 1 MINUTE TO LOAD
ALL DATA INTO DEVEXRESS GRID
How can it be faster ?
My Code is there;
private void ReLoadData()
{
using (SqlConnection ConnLocal = new
SqlConnection(Program.GetSQLConnectionString()))
{
ConnLocal.Open();
string FilterKeyword = edSearch.Text;
FilterKeyword = FilterKeyword.Replace("*", "%");
using (SqlCommand CommLocal = ConnLocal.CreateCommand())
{
CommLocal.CommandText += "SELECT * ";
CommLocal.CommandText += "FROM PR_MATS MATS ";
CommLocal.CommandText += "WHERE ( (MATS.MCODE LIKE '" +
FilterKeyword + "%') OR (MATS.MDEFN LIKE '" + FilterKeyword + "') ) ";
CommLocal.CommandText += "ORDER BY MATS.R_MODATE DESC
";
using (SqlDataAdapter adLocal = new
SqlDataAdapter(CommLocal))
{
DataSet tbLocal = new DataSet();
int MatsCount = adLocal.Fill(tbLocal, "MATS"); //
MATSCOUNT = 45000, This line lasts 2 second.
int MatsRow = vvMats.FocusedRowHandle;
grdMats.DataSource = tbLocal;
grdMats.DataMember = "MATS"; // THIS LINE
WAITS FOR MORE THAN 1 MINUTE TO LOAD ALL DATA INTO DEVEXRESS GRID
vvMats.FocusedRowHandle = MatsRow;
vvMats.BestFitColumns();
}
}
if (ConnLocal.State != ConnectionState.Closed)
{
ConnLocal.Close();
}
}
}
I have a DEVEXPRESS grid on my form
When I try to load data into the form,
If row count is huge (this example : 45000 row is returned, column count =~
10)
This line waits for a long time to load data into grid
grdMats.DataMember = "MATS"; // THIS LINE WAITS FOR 1 MINUTE TO LOAD
ALL DATA INTO DEVEXRESS GRID
How can it be faster ?
My Code is there;
private void ReLoadData()
{
using (SqlConnection ConnLocal = new
SqlConnection(Program.GetSQLConnectionString()))
{
ConnLocal.Open();
string FilterKeyword = edSearch.Text;
FilterKeyword = FilterKeyword.Replace("*", "%");
using (SqlCommand CommLocal = ConnLocal.CreateCommand())
{
CommLocal.CommandText += "SELECT * ";
CommLocal.CommandText += "FROM PR_MATS MATS ";
CommLocal.CommandText += "WHERE ( (MATS.MCODE LIKE '" +
FilterKeyword + "%') OR (MATS.MDEFN LIKE '" + FilterKeyword + "') ) ";
CommLocal.CommandText += "ORDER BY MATS.R_MODATE DESC
";
using (SqlDataAdapter adLocal = new
SqlDataAdapter(CommLocal))
{
DataSet tbLocal = new DataSet();
int MatsCount = adLocal.Fill(tbLocal, "MATS"); //
MATSCOUNT = 45000, This line lasts 2 second.
int MatsRow = vvMats.FocusedRowHandle;
grdMats.DataSource = tbLocal;
grdMats.DataMember = "MATS"; // THIS LINE
WAITS FOR MORE THAN 1 MINUTE TO LOAD ALL DATA INTO DEVEXRESS GRID
vvMats.FocusedRowHandle = MatsRow;
vvMats.BestFitColumns();
}
}
if (ConnLocal.State != ConnectionState.Closed)
{
ConnLocal.Close();
}
}
}