|
-
Jun 15th, 2005, 06:36 PM
#1
Frenzied Member
Re: Datagrid
i would make your sub return a boolean. that boolean is determined on whether or not the dataset has data. then, when you call that function, you can display a message box if it returns false.
-
Jun 15th, 2005, 06:43 PM
#2
Frenzied Member
Re: Datagrid
Code:
private bool BindSearchData(string strSearchSql)
{
OleDbConnection scnnNW = new OleDbConnection(SQL_CONNECTION_STRING);
OleDbCommand scmd = new OleDbCommand(strSearchSql, scnnNW);
OleDbDataAdapter sda = new OleDbDataAdapter(scmd);
DataSet ds = new DataSet();
if (sda.Fill(ds) = 0)
{return false;}
dgCompany.DataSource = ds;
dgCompany.DataBind();
}
-
Jun 16th, 2005, 12:49 PM
#3
Frenzied Member
Re: Datagrid
oops! the code should read like this 
Code:
private bool BindSearchData(string strSearchSql)
{
OleDbConnection scnnNW = new OleDbConnection(SQL_CONNECTION_STRING);
OleDbCommand scmd = new OleDbCommand(strSearchSql, scnnNW);
OleDbDataAdapter sda = new OleDbDataAdapter(scmd);
DataSet ds = new DataSet();
if (sda.Fill(ds) == 0)
{return false;}
dgCompany.DataSource = ds;
dgCompany.DataBind();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|