omegalove
asked on
'System.Data.SqlClient.SqlConnection' does not contain a definition
Error 10 'System.Data.SqlClient.Sql Connection ' does not contain a definition for 'ExecuteQuery' and no extension method 'ExecuteQuery' accepting a first argument of type 'System.Data.SqlClient.Sql Connection ' could be found (are you missing a using directive or an assembly reference?) C:\inetpub\wwwroot\OmegaLo ve.Web\Ome gaLove.Web \Controls\ UniGrid.as cx.cs 583 26 OmegaLove.Web
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.Conne ctionStrin gs["omegal oveConnect ionString" ].Connecti onString;
ds = con.ExecuteQuery(this.Quer y, this.QueryParameters, this.CompleteWhereConditio n, this.OrderBy);
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.Conne
ds = con.ExecuteQuery(this.Quer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hello?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
con.ConnectionString.Open( )
does not contain definion for Open and Close?
does not contain definion for Open and Close?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
con.ConnectionString.Open( )
I have the namespace.
I have the namespace.
ASKER
Still does not work.
ASKER
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.Conne ctionStrin gs["omegal oveConnect ionString" ].Connecti onString;
con.Open();
ds = con.ExecuteQuery(this.Quer y, this.QueryParameters, this.CompleteWhereConditio n, this.OrderBy);
con.Close();
Error 16 'System.Data.SqlClient.Sql Connection ' does not contain a definition for 'ExecuteQuery' and no extension method 'ExecuteQuery' accepting a first argument of type 'System.Data.SqlClient.Sql Connection ' could be found (are you missing a using directive or an assembly reference?) C:\inetpub\wwwroot\OmegaLo ve.Web\Ome gaLove.Web \Controls\ UniGrid.as cx.cs 596 26 OmegaLove.Web
con.ConnectionString = ConfigurationManager.Conne
con.Open();
ds = con.ExecuteQuery(this.Quer
con.Close();
Error 16 'System.Data.SqlClient.Sql
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
u lost me.
public void ReloadData()
{
DataSet ds = null;
// if datasource for unigrid is query (not dataset), then execute query
if ((this.Query != null) && (this.Query != string.Empty))
{
// Reload the data with current parameters
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.Conne ctionStrin gs["omegal oveConnect ionString" ].Connecti onString;
con.Open();
// ds = con.ExecuteQuery(this.Quer y, this.QueryParameters, this.CompleteWhereConditio n, this.OrderBy);
con.Close();
}
// external dataset is used
else
{
if (this.OnDataReload != null)
{
ds = OnDataReload(CompleteWhere Condition) ;
}
else
{
ds = (DataSet)(this.DataSource) ;
}
}
public void ReloadData()
{
DataSet ds = null;
// if datasource for unigrid is query (not dataset), then execute query
if ((this.Query != null) && (this.Query != string.Empty))
{
// Reload the data with current parameters
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.Conne
con.Open();
// ds = con.ExecuteQuery(this.Quer
con.Close();
}
// external dataset is used
else
{
if (this.OnDataReload != null)
{
ds = OnDataReload(CompleteWhere
}
else
{
ds = (DataSet)(this.DataSource)
}
}
ASKER
k
ASKER
con.open?
con.close?
// Reload the data with current parameters
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.Conne
ds = con.ExecuteQuery(this.Quer
I don't have the syntax.