Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
In a practical sense yes, but this is dangerous. anyone can learn to drive just by getting in a car. You don't want to be anywhere near them when they do.There is no right or wrong way to do things as long as you learn.
Presenter presenter = new Presenter();
MyGridView.DataSource = presenter.GetData(1);
MyGridview.DataBind();
public class Presenter
{
public IEnumerable GetData(int id)
{
DataTable results = new DataTable();
ConnectionStringSetting settings = ConfigurationManager.ConnectionStrings["key"];
using(IDbConnection connection = DbProviderFactory.CreateConnection(settings.Provider))
{
connection.ConnectionString = settings.ConnectionString;
connection.Open();
using(IDbCommand command = connection.CreateCommand)
{
command.CommandText = "select [fields,] from [table] where [column] = @value";
IDbParameter parameter = command.CreateParameter("value");
parameter.Value = id;
command.Parameters.Add(parameter);
results.Load(command.ExecuteReader());
}
}
return results;
}
}