首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏全栈程序员必看

    SqlDataSource WEB控件:当DeleteCommandType=”storedProcedure”时「建议收藏」

    delete from Articles where ArticleID = @a RETURN 在aspx页面上,增加GridView,并指定数据源SqlDataSource 通过向导生成的SqlDataSource1: <asp:SqlDataSource ID=”SqlDataSource1″ runat=”server” ConnectionString > 通过向导生成的GridView1,并增加删除按钮列: <asp:GridView ID=”GridView1″ runat=”server” DataSourceID=”SqlDataSource1 加入ArticleID作为主键 <asp:GridView ID=”GridView1″ runat=”server” DataSourceID=”SqlDataSource1″ DataKeyNames 在接下来的N久时间里,我无数次的试验,终于这样搞定了: < asp:SqlDataSource ID =”SqlDataSource1″ runat =”server”

    39430编辑于 2022-09-18
  • 来自专栏c#开发者

    Add a FileUpload control to your GridView [转]

    Note: In this post I decided to use the SqlDataSource, only for making the example in this post small The following is an example of a SqlDataSource control where an Image parameter is added, and where the ConnectionString="<%$ ConnectionStrings:CustomerConnectionString %>"    ID="SqlDataSource1" runat="     fileUpload.SaveAs(System.IO.Path.Combine(Server.MapPath("Images"), fileUpload.FileName));     SqlDataSource1 ConnectionString="<%$ ConnectionStrings:CustomerConnectionString %>"             ID="SqlDataSource1

    1.7K60发布于 2018-04-12
  • 来自专栏Java架构师必看

    ASP.NET2.0中用Gridview控件操作数据

    " DataTextField="ContactTitle" DataValueField="ContactTitle"> </asp:DropDownList> <asp:SqlDataSource " DataTextField="ContactTitle" DataValueField="ContactTitle" ></asp:DropDownList> <asp:SqlDataSource 集合(注意要一一对应),最后使用sqldatasource的insert方法,就可以成功向数据库增加一条新记录了。 另外,为了在 窗体加载时, 显示数据库northwind中customers表的数据,需要设置sqldatsource1的属性,如下代码: <asp:SqlDataSource ID="SqlDataSource1 之后并指出sqldatasource的updatecommand语句。

    2.1K10发布于 2021-03-22
  • 来自专栏后端

    C#一分钟浅谈:数据绑定与数据源控件

    ASP.NET中常见的数据源控件SqlDataSource:用于连接SQL Server数据库。ObjectDataSource:用于绑定到业务对象或方法。 实践案例下面通过一个简单的例子来展示如何使用SqlDataSource和GridView控件进行数据绑定。步骤一:创建数据库表首先,我们需要有一个数据库表。 控件在ASP.NET Web应用程序中添加一个SqlDataSource控件,并配置其连接字符串以及查询语句。 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString 步骤三:使用GridView显示数据接下来,在页面上添加一个GridView控件,并设置其数据源为上面创建的SqlDataSource

    1.3K10编辑于 2024-10-10
  • 来自专栏c#开发者

    Using ASP.NET and jQuery to Pass Multiple Values from a GridView to Another Page

    </title> <script src="Script/jquery-1.2.6.js" type="text/javascript"></script> Now drag and drop a SqlDataSource The design code will look similar to the following: <asp:SqlDataSource ID="SqlDataSource1" runat="server SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [Address], [City] FROM [Customers]"> </asp:SqlDataSource connectionStrings> Now add a GridView control to the page and using the smart tag, select the DataSource to be SqlDataSource1 ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="SqlDataSource1

    1.2K40发布于 2018-04-12
  • 来自专栏cs

    ASP.NET 数据库访问

    <title></title> </head> <body> <form id="form1" runat="server">

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:dflxConnectionString %>" ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:dflxConnectionString %>" 数据库.jpg 先把数据库文件,引入到vs中,实现了网页对表格的增删改查的相关操作 相关的更多知识点文章(方便自己他人查看) 数据绑定(数据源控件 -- SqlDataSource) 使用SqlDataSource 插入、更新以及删除数据 asp.net学习之SqlDataSource GridView DetailsView DetailsView的使用

    6.6K60发布于 2018-04-27
  • 来自专栏c#开发者

    Pass Multiple Values from a GridView to Another Page using ASP.NET

    Drag and drop a SqlDataSource Control to the page and use the wizard to connect to the Northwind database The design code will look similar to the following: <asp:SqlDataSource ID="SqlDataSource1" runat="server Step 2: Now add a GridView control to the page and using the smart tag, select the DataSource to be SqlDataSource1 ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="SqlDataSource1 ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString

    1.5K50发布于 2018-04-12
  • 来自专栏Java架构师必看

    asp.net 2.0中一次性更新所有GRIDVIEW的记录

    有两种方法,一种是使用sqldatasource来更新 所有记录,但这个方法比较慢,因为每更新一条记录都要建立数据连接并执行updatecommand,会影响性能, 但还是先来看下实现方法: <%@ GridView1.Rows.Count; i++)         {             GridViewRow row = GridView1.Rows[i];             SqlDataSource1 UpdateParameters[0].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox2")).Text;             SqlDataSource1 .UpdateParameters[2].DefaultValue = GridView1.DataKeys[i].Value.ToString();             SqlDataSource1 ID="SqlDataSource1" Runat="server"             SelectCommand="SELECT [CustomerID], [CompanyName], [

    1.5K30发布于 2021-03-22
  • 来自专栏Java架构师必看

    ASP.NET 2.0中GRIDVIEW排序

    "form1" runat="server">    

            <asp:GridView ID="GridView1" Runat="server" DataSourceID="<em>SqlDataSource</em>1 SortExpression="CompanyName"></asp:BoundField>             </Columns>         </asp:GridView>         <asp:SqlDataSource ID="SqlDataSource1" Runat="server" SelectCommand="SELECT customerid,companyname FROM customers " ConnectionString ="server=localhost;uid=sa;password=XXX;database=northwind">         </asp:SqlDataSource>    
       

    1.4K20发布于 2021-03-22
  • 来自专栏技术小牛

    ASP.NET中通过文本框的输入实现"拼音码"动态查询的效果

    protected void TextBox1_Changed(object sender, EventArgs e)                   {                           SqlDataSource2 course WHERE pinyima LIKE '"+TextBox1.Text+"%'";                          DropDownList1.DataSource = SqlDataSource2

    2K30发布于 2021-03-15
  • 来自专栏Java架构师必看

    自定义GridView分页模板

    runat="server" allowpaging="True" pagesize="10"             autogeneratecolumns="False" datasourceid="SqlDataSource1                                             </pagertemplate>         </asp:gridview>         <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="Data Source=. SELECT [CompanyName], [ContactTitle], [Phone], [Fax], [ContactName] FROM [Customers]">         </asp:sqldatasource

    1.4K30发布于 2021-03-22
  • 来自专栏张善友的专栏

    如何在ASP.NET 2.0中定制Expression Builders

    例如我们看个例子: ASPX页面中如下: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$connectionStrings :Pubs %>" SelectCommand="select * from catalog"></asp:SqlDataSource> web.config文件中如下: <configuration

    1.2K70发布于 2018-01-22
  • 来自专栏全栈程序员必看

    dropdownlist绑定数据源_不能绑定到字段或数据成员

    如何使用DropDownList 控件绑定数据呢,今天我们来介绍一下比较常用的一种方法——前后台结合方式: 首先,我们需要拉一个DropDownList 控件: 然后,通过控件配置SqlDataSource DataTextField(数据源中提供项文本的字段)和DataValueField(数据源中提供项值的字段)属性: 前台显示如下: 配置完之后,一定不要忘记删除 DataSourceID 属性和生成的 SqlDataSource

    1K20编辑于 2022-11-08
  • 来自专栏liulun

    四:理解Page类的运行机制(例:基于PageStatePersister的页面状态存取)

                 <asp:GridView ID="GridView1" runat="server" AllowPaging="True"              DataSourceID="<em>SqlDataSource</em>1                     SortExpression="inputTime" />             </Columns>         </asp:GridView>         <asp:SqlDataSource  ID="SqlDataSource1" runat="server"              ConnectionString="<%$ ConnectionStrings:AntMallConnectionString SelectCommand="SELECT [fullPrice], [inputTime], [memo], [title], [defaultPic] FROM [Product]">         </asp:SqlDataSource

    60210编辑于 2022-05-08
  • 来自专栏Java架构师必看

    Gridview][UpdateCommand的写法要点]

    我们只需要添加一个sqldatasouce控件和一个GridView,再为sqldatasource写上正确的UpdateCommand语句就可以达到自动更新数据的目的。 Width="100"></asp:TextBox>                 </EditItemTemplate>             </asp:TemplateField> 则在写SqlDataSource

    1.4K20发布于 2020-10-26
  • 来自专栏跟着阿笨一起玩NET

    分享一些WinForm数据库连接界面UI

    Microsoft.Data.ConnectionUI.DataSource.OracleDataSource); // Oracle             connDialog.DataSources.Add(Microsoft.Data.ConnectionUI.DataSource.SqlDataSource             // 初始化             connDialog.SelectedDataSource = Microsoft.Data.ConnectionUI.DataSource.SqlDataSource

    2.3K10发布于 2018-09-19
  • 来自专栏全栈程序员必看

    oracle数据库connectionstring,oracle数据库 connectionstring

    tnsnames.ora 连接或使用netca 配置本地服务名; 2、SIEBEL Tools安装 配置参数: 1)、双击Siebel… 文章 ysisl222 2011-03-23 568浏览量 c# asp.net sqldatasource (6) sqldatasource是用来从SQL Server、Oracle Server、ODBC数据源OLE DB数据源。 或者windowsSQLCE数据库中的检索数据;sqldatasource的声明:<asp:SqlDataSource ID=”SourceName” Runat=”server”… 文章 科技小先锋

    6.1K40编辑于 2022-09-14
  • 来自专栏静默虚空的博客

    [C#][控件]常用控件命名规范

    odsMenus Repeater rpt rptQueryResults ReportViewer rvw rvwRecord SiteMapDataSource smds smdsSite SqlDataSource

    87110编辑于 2022-05-07
  • 来自专栏杰的记事本

    ASP.NET2.0 ObjectDataSource的使用详解

    此默认命名约定的使用假设 Keys 和 Values 字典的内容相互排斥 — 即用户能够在数据绑定控件处于编辑模式时更新的字段值的命名应该与用于匹配要更新的行的字段值(对于 SqlDataSource

    81310发布于 2019-09-04
  • 来自专栏技术小牛

    ASP.NET中通过GRIDVIEW"选择"的按钮将数据显示到TEXTBOX中

    small;" Width="864px" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1

    4.7K10发布于 2021-03-15
领券