Yes, Ignacio. This is what I have in the bindGrid method. See arrows. Is
it enough?
private void bindGrid()
{
SqlConnection conn = new SqlConnection
(ConfigurationSettings.AppSettings["SqlConnectionString"]);
conn.Open();
SqlCommand dataCommand = new SqlCommand();
dataCommand.Connection = conn;
dataCommand.CommandText = "SELECT GEM.customers.name AS [Institution
Name], "
+ "GEM.customers.CustomerSince AS [Customer Since], "
+ "GEM.contacts.name_first AS [First Name], "
+ "GEM.contacts.name_last AS [Last Name], "
+ "GEM.contacts.title AS [Contact Title], "
+ "GEM.customers.address_1 AS Address, "
+ "GEM.customers.city AS City, "
+ "GEM.customers.state AS State, "
+ "GEM.customers.province AS Province, "
+ "GEM.customers.zip_code AS [Zip Code], "
+ "GEM.customers.postal_code AS [Postal Code], "
+ "GEM.customers.country AS Country, "
+ "GEM.customers.phone AS Phone, "
+ "GEM.contacts.email AS [E-Mail Address], "
+ "GEM.customers.cust_id "
+ "FROM GEM.customers INNER JOIN GEM.config_usernames ON "
+ "GEM.customers.cust_id = GEM.config_usernames.cust_id INNER JOIN "
+ "GEM.contacts ON GEM.config_usernames.contact_id =
GEM.contacts.contact_id ORDER BY GEM.customers.name";
SqlDataAdapter adapter = new SqlDataAdapter(dataCommand);
DataSet ds = new DataSet();
adapter.Fill(ds);
Cache["CustomerData"] = ds; <-----------------------------------------
dgCustInfo.DataSource = ds;
ds = (DataSet)Cache["CustomerData"]; <------------------------------
dgCustInfo.DataBind();
conn.Close();
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.uswrote
in message news:ub**************@TK2MSFTNGP03.phx.gbl...
Hi,
What you mean with caching data?
Are you refering to a dataset?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Antonio" <in**@awfulcards.comwrote in message
news:eN**************@TK2MSFTNGP02.phx.gbl...
>Hi, everyone.
Can someone direct me to the "how-to" on cachine data from a sql to a
datagrid?
Thanks