Results 1 to 6 of 6

Thread: Datagrid

Hybrid View

  1. #1
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    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.

  2. #2
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    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();
    
            }

  3. #3
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    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
  •  



Click Here to Expand Forum to Full Width