zeeshan akram

zeeshan akram

  • NA
  • 23
  • 1.2k

type or namespace " " does not exist in current context :

Jul 9 2017 3:06 PM
here is the code:
default.aspx.cs
protected void btnSearch_Click(object sender, EventArgs e)
{
Panel1.Visible = true;
GridView1.DataSource = ServicesBLL.SearchBuses // here is the error 
(ddlFrom.SelectedValue,
ddlTo.SelectedValue,
txtJdate.Text,
ddlBusType.SelectedValue);
GridView1.DataBind();
}
 
this is ServicesBLL.cs file code
 
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Data.DataTable;
public class ServicesBLL
{
public DataTable SearchBuses(string fromcity, string tocity, string jdate, string bustype)
{
return ServicesDAL.SearchBuses(fromcity, tocity, jdate, bustype);
}
}
 
 and here is the  ServiceDAL code
public static DataTable SearchBuses(string fromcity, string tocity, string jdate, string bustype)
{
SqlConnection con = new SqlConnection(Database.ConnectionString);
try
{
con.Open();
SqlDataAdapter sda = new SqlDataAdapter("searchbuses", con);
sda.SelectCommand.Parameters.AddWithValue("@fromcity", fromcity);
sda.SelectCommand.Parameters.AddWithValue("@tocity", tocity);
sda.SelectCommand.Parameters.AddWithValue("@jdate", jdate);
sda.SelectCommand.Parameters.AddWithValue("@bustype", bustype);
sda.SelectCommand.CommandType = CommandType.StoredProcedure;
DataSet ds = new DataSet();
sda.Fill(ds, "buses");
return ds.Tables[0];
}
catch (Exception ex)
{
HttpContext.Current.Trace.Write(
"Error in SearchBuses -->" + ex.Message);
return null;
}
finally
{
con.Close();
}
}
 
 all the remaining things are Fine but same error is generating
plz help 
 
 

Answers (1)