AdRotator控件和网格视图 [英] AdRotator control and Grid View

查看:87
本文介绍了AdRotator控件和网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,
如何使用AdRotator控件并在网格"视图中显示总值.
谢谢.

sir,
how to AdRotator control use and Display the total values in Grid view.
Thank You.

推荐答案

将AdRotator控件添加到Web窗体中

1.在Visual Studio中查看Default.aspx Web窗体.
2.将AdRotator控件从工具箱的"Web窗体"部分拖到Default.aspx Web窗体上.
3.将AdRotator控件放在Web窗体顶部中心附近,并调整其大小,使其大小与之前创建的图像相同. (要更精确地控制大小,请设置高度"和宽度"属性.)
4.单击AdRotator1(新添加的AdRotator控件),然后按F4键查看其属性.
5.将AdvertisementFile属性设置为Adverts.xml.
6.保存Default.aspx,并生成项目.
Add an AdRotator Control to a Web Form

1.View the Default.aspx Web Form in Visual Studio.
2.Drag an AdRotator control from the Web Forms section of the toolbox onto the Default.aspx Web Form.
3.Position the AdRotator control near the top center of the Web Form, and resize it so that it is the same size as the images that you created earlier. (To control the size more accurately, set the Height and Width properties).
4.Click AdRotator1 (the newly added AdRotator control), and then press the F4 key to view its properties.
5.Set the AdvertisementFile property to Adverts.xml.
6.Save Default.aspx, and build the project.


在页脚的网格视图中显示总值

To display the total values in Grid view at footer

public int gettotal()
  {   
     SqlConnection conn = new SqlConnection("connectionstring");
     conn.Open();
     SqlCommand cmd = new SqlCommand("SELECT SUM(salary) FROM emp", conn);
     int totalsal = Convert.ToInt32(cmd.ExecuteScalar());
     return totalsal;
  }


这篇关于AdRotator控件和网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆