當前位置: 首頁>>代碼示例>>C#>>正文


C# SqlDataSource.DataBind方法代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.SqlDataSource.DataBind方法的典型用法代碼示例。如果您正苦於以下問題:C# SqlDataSource.DataBind方法的具體用法?C# SqlDataSource.DataBind怎麽用?C# SqlDataSource.DataBind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.UI.WebControls.SqlDataSource的用法示例。


在下文中一共展示了SqlDataSource.DataBind方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LoadFilteredDRDetails

        public void LoadFilteredDRDetails(SqlDataSource DRDetailsDataSource, int DRID_S, int DRID_E, int CustomerNumber)
        {
            StringBuilder search_command = new StringBuilder();
            search_command.Append(" SELECT DR.DRNo, DRDtl.SKU, DRDtl.StyleNo, DR.ItemStatus, DRDtl.Quantity, DRDtl.UnitPrice FROM DR INNER JOIN DRDtl ON DR.ID = DRDtl.DRID ");
            search_command.Append(" where DR.ID between @ID_S and @ID_E and custno [email protected]_Number ");
            Parameter prmDRIDS = new Parameter
            {
                 DbType = System.Data.DbType.Int32 ,
                 Name = "ID_S",
                  DefaultValue = DRID_S.ToString(),
            };

            Parameter prmDRIDE = new Parameter
            {
                DbType = System.Data.DbType.Int32,
                Name = "ID_E",
                DefaultValue = DRID_E.ToString(),
            };
            Parameter prmCustomerNumber = new Parameter
            {
                DbType = System.Data.DbType.Int32,
                Name = "Customer_Number",
                DefaultValue = CustomerNumber.ToString(),
            };
            DRDetailsDataSource.SelectParameters.Add(prmDRIDS);
            DRDetailsDataSource.SelectParameters.Add(prmDRIDE);
            DRDetailsDataSource.SelectParameters.Add(prmCustomerNumber);
            DRDetailsDataSource.SelectCommand = search_command.ToString();
            DRDetailsDataSource.DataBind();
            //       SELECT DR.DRNo, DRDtl.SKU, DRDtl.StyleNo, DR.ItemStatus, DRDtl.Quantity, DRDtl.UnitPrice FROM DR
            //INNER JOIN DRDtl ON DR.ID = DRDtl.DRID
            //where DR.ID between @IDS and @IDE and custno [email protected]
        }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:33,代碼來源:DeliveryReceiptsManager.cs

示例2: SearchOutletDataSource

 public SqlDataSource SearchOutletDataSource(SqlDataSource sql_data_source, string search_parameter, string Brand)
 {
     //if (Brand != "ALL")
     //{
         //if (search_parameter != string.Empty)
     //    {
     //        sql_data_source.SelectCommand = "SELECT [CustNo], [CompName], [brand] FROM [CustInfo] where brand ='"+ Brand +"' and CompName Like '%" +
     //            search_parameter + "%'";
     //    }
     //    else
     //    {
     //        sql_data_source.SelectCommand = "SELECT [CustNo], [CompName], [brand] FROM [CustInfo] where brand ='" + Brand + "' ";
     //    }
     //}
     //else
     //{
         if (search_parameter != string.Empty)
         {
             sql_data_source.SelectCommand = "SELECT [CustNo], [CompName], [brand] FROM [CustInfo] where CompName Like '%" +
                 search_parameter + "%'";
         }
         else
         {
             sql_data_source.SelectCommand = "SELECT [CustNo], [CompName], [brand] FROM [CustInfo] ";
         }
     //}
     sql_data_source.DataBind();
     return sql_data_source;
 }
開發者ID:DennisPitallano,項目名稱:IRMS-ACCOUNTING,代碼行數:29,代碼來源:CustomerManager.cs

示例3: FilterSalesInvoiceList

 public void FilterSalesInvoiceList(SqlDataSource datasource, string filter_field_type)
 {
     switch (filter_field_type)
     {
         case "POSTED":
             datasource.SelectCommand = SearchCommand(filter_field_type);
             datasource.DataBind();
             break;
         case "UNPOSTED":
             datasource.SelectCommand = SearchCommand(filter_field_type);
             datasource.DataBind();
             break;
         case "CANCELLED":
             datasource.SelectCommand = SearchCommand(filter_field_type);
             datasource.DataBind();
             break;
     }
 }
開發者ID:DennisPitallano,項目名稱:IRMS-WAREHOUSE,代碼行數:18,代碼來源:SalesInvoiceManager.cs

示例4: SearchCustomers

 public void SearchCustomers(SqlDataSource CustomerDatasource, string search_parameter, string Brand)
 {
     StringBuilder commandText = new StringBuilder();
     commandText.Append("SELECT [CustNo], [CompName],[PGNo] FROM [CustInfo] WHERE ([brand] = '" + Brand + "')");
     if (search_parameter != "")
     {
         commandText.Append(" and CompName LIKE'%"+search_parameter+"%'");
     }
     CustomerDatasource.SelectCommand = commandText.ToString();
     CustomerDatasource.DataBind();
 }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:11,代碼來源:ItemsReprocessManager.cs

示例5: SeachCustomers

 public void SeachCustomers(SqlDataSource CustomerDataSource, string search_parameter)
 {
     StringBuilder search_command = new StringBuilder();
     search_command.Append("SELECT [CustNo], [CompName] FROM [CustInfo] ");
     if (!string.IsNullOrEmpty(search_parameter))
     {
         search_command.Append(" WHERE CompName LIKE '%"+search_parameter+"%' ");
     }
     CustomerDataSource.SelectCommand = search_command.ToString();
     CustomerDataSource.DataBind();
 }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:11,代碼來源:DeliveryReceiptsManager.cs

示例6: SearchGeneralMemo

        public void SearchGeneralMemo(SqlDataSource data_source, string search_parameter)
        {
            StringBuilder command_text = new StringBuilder();
            command_text.Append("SELECT [ID], [MemoNo], [MemoDate], [BrandName], [GrpNo], [PriceType], [FromDate], [ToDate], [Status] FROM [GenMemo] WHERE ");
            if (search_parameter != "")
            {
                command_text.Append(" MemoNo  LIKE '%" + search_parameter + "%' AND Status = 'Pending' ");
            }

            data_source.SelectCommand = command_text.ToString();
            data_source.DataBind();
        }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:12,代碼來源:GeneralMemoConcessionManager.cs

示例7: SearchUsers

 public SqlDataSource SearchUsers(SqlDataSource UsersDataSource, string search_parameter)
 {
     StringBuilder CommandText = new StringBuilder();
     CommandText.Append("SELECT Users.ID, Users.UserName, Users.FullName, Users.Email, lstDept.ListDesc, lstUserLevel.ListDesc AS UserLevel FROM Users INNER JOIN lstDept ON Users.DeptID = lstDept.ID INNER JOIN lstUserLevel ON Users.UserLevelID = lstUserLevel.ID WHERE (lstDept.ID = 4) ");
     if (search_parameter != "")
     {
         CommandText.Append(" AND Users.UserName LIKE '%" + search_parameter + "%'");
     }
     UsersDataSource.SelectCommand = CommandText.ToString();
     UsersDataSource.DataBind();
     return UsersDataSource;
 }
開發者ID:DennisPitallano,項目名稱:IRMS-ACCOUNTING,代碼行數:12,代碼來源:UserBrandManager.cs

示例8: AdvanceSearch

 public void AdvanceSearch(SqlDataSource datasource, string search_parameter, string filter_type, DateTime date_from, DateTime date_to, string CompanyName)
 {
     if (filter_type != string.Empty)
     {
         switch (filter_type)
         {
             case "POSTED":
                 datasource.SelectCommand = AdvanceSearchCommand(search_parameter, "1", filter_type, date_from, date_to, CompanyName);
                 datasource.DataBind();
                 break;
             case "UNPOSTED":
                 datasource.SelectCommand = AdvanceSearchCommand(search_parameter, "0", filter_type, date_from, date_to, CompanyName);
                 datasource.DataBind();
                 break;
             case "CANCELLED":
                 datasource.SelectCommand = AdvanceSearchCommand(search_parameter, "1", filter_type, date_from, date_to, CompanyName);
                 datasource.DataBind();
                 break;
             //default:
             //    string CommandText;
             //    CommandText = "SELECT [ID], [CRSID], [CRSNo], [CRSDate], [Customer], [TotalAmt], [PUSNo], [PkgNo], [ItemStatus] FROM CRS";
             //    CommandText += "WHERE CRSDate BETWEEN '" + date_from + "' AND '" + date_to + "'";
             //    if (search_parameter != string.Empty)
             //    {
             //        CommandText += " AND CRSNo LIKE '%" + search_parameter + "%' ";
             //        //CommandText += " OR ID LIKE '%" + search_parameter + "%' ";
             //    }
             //    if (!CompanyName.Equals(string.Empty))
             //    {
             //        CommandText += " AND Customer LIKE '%" + CompanyName + "%'";
             //    }
             //    datasource.SelectCommand = CommandText;
             //    datasource.DataBind();
                 //break;
         }
     }
     else
     {
     }
 }
開發者ID:DennisPitallano,項目名稱:IRMS-WAREHOUSE,代碼行數:40,代碼來源:CustomerReturnSlipManager.cs

示例9: FilterStyles

        public void FilterStyles(SqlDataSource StylesDataSource, string Brand="")
        {
            StringBuilder commandText = new StringBuilder();
            commandText.Append("SELECT DISTINCT(Style.StyleNo) AS STYLE_NUMBER, [StyleID] AS RECORD_NO, Style.[StyleDesc] AS DESCRIPTION, Cost AS COST_PRICE,Style.BrandName,Product.AP_Type FROM [STYLE] INNER JOIN Product on Product.StyleNo=Style.StyleNo ");
            if (Brand != "")
            {
                commandText.Append(" WHERE Style.BrandName ='" + Brand + "' ");
            }
            commandText.Append(" ORDER BY StyleID DESC");

            StylesDataSource.SelectCommand = commandText.ToString();
            StylesDataSource.SelectCommandType = SqlDataSourceCommandType.Text;
            StylesDataSource.DataBind();
        }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:14,代碼來源:ItemsReprocessManager.cs

示例10: SeachOutRightmrkDownMemoIncludeDateRange

        public void SeachOutRightmrkDownMemoIncludeDateRange(SqlDataSource OutRightDataSource, string search_parameter, DateTime date_from, DateTime date_to)
        {
            string CommandText = string.Empty;
            if(search_parameter != string.Empty)
            {
                CommandText = "SELECT MDMemo.ID, MDMemo.MemoNo, MDMemo.MemoDate, MDMemo.Header, MDMemo.Intro, CustInfo.CompName, MDMemo.RemInvDate, MDMemo.GenMemoNo, MDMemo.Message, MDMemo.Footer FROM MDMemo INNER JOIN CustInfo ON MDMemo.CustNo = CustInfo.CustNo WHERE  "
                    + "  MDMemo.MemoNo LIKE '%" +
                    search_parameter + "%' OR CustInfo.CompName LIKE '%" +
                    search_parameter + "%' AND (MDMemo.MemoType = 'Outright') AND MDMemo.MemoDate BETWEEN '"+date_from +"' AND '"+ date_to +"'";
            }else {
                CommandText = "SELECT MDMemo.ID, MDMemo.MemoNo, MDMemo.MemoDate, MDMemo.Header, MDMemo.Intro, CustInfo.CompName, MDMemo.RemInvDate, MDMemo.GenMemoNo, MDMemo.Message, MDMemo.Footer FROM MDMemo INNER JOIN CustInfo ON MDMemo.CustNo = CustInfo.CustNo WHERE  "
                      + "  MDMemo.MemoDate BETWEEN '" + date_from + "' AND '" + date_to + "' AND (MDMemo.MemoType = 'Outright')";
            }

            OutRightDataSource.SelectCommand = CommandText;
            OutRightDataSource.DataBind();
        }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:17,代碼來源:OutRightMarkDownMemoManager.cs

示例11: SearchOutletDataSource

 public SqlDataSource SearchOutletDataSource(SqlDataSource sql_data_source, string search_parameter)
 {
     if (search_parameter != string.Empty)
         {
             sql_data_source.SelectCommand = "SELECT [CustNo], [CompName], [CustCode], [CustType], [brand], [BrandNameNo], [ArrangeType], [Addr1], [BRAND_CODE] FROM [CustInfo] a inner join [BRANDS] b on a.[brand]=b.[BRAND_DESCRIPTION] where CompName Like '%" + search_parameter + "%'";
         }
         else
         {
             sql_data_source.SelectCommand = "SELECT [CustNo], [CompName], [CustCode], [CustType], [brand], [BrandNameNo], [ArrangeType], [Addr1] FROM [CustInfo]";
         }
         sql_data_source.DataBind();
         return sql_data_source;
 }
開發者ID:DennisPitallano,項目名稱:IRMS-WAREHOUSE,代碼行數:13,代碼來源:PulloutHeaderManager.cs

示例12: SearchStyleDataSource

 public SqlDataSource SearchStyleDataSource(SqlDataSource sql_data_source, string search_parameter)
 {
     if (search_parameter != string.Empty)
         {
             sql_data_source.SelectCommand = "SELECT [StyleNo], [BrandName], [StyleDesc], [AP_Type], [BRAND_CODE] FROM [Style] a inner join [BRANDS] b on a.BrandName=b.BRAND_DESCRIPTION where StyleNo Like '%" + search_parameter + "%'";
         }
         else
         {
             sql_data_source.SelectCommand = "SELECT [StyleNo], [BrandName], [StyleDesc], [AP_Type], [BRAND_CODE] FROM [Style] a inner join [BRANDS] b on a.BrandName=b.BRAND_DESCRIPTION";
         }
         sql_data_source.DataBind();
         return sql_data_source;
 }
開發者ID:DennisPitallano,項目名稱:IRMS-WAREHOUSE,代碼行數:13,代碼來源:PulloutHeaderManager.cs

示例13: SearchConcessionMarkDownMemo

 public void SearchConcessionMarkDownMemo(SqlDataSource OutRightDataSource, string search_parameter)
 {
     OutRightDataSource.SelectCommand = "SELECT MDMemo.ID, MDMemo.MemoNo, MDMemo.MemoDate, MDMemo.Header, MDMemo.Intro, CustInfo.CompName, MDMemo.RemInvDate, MDMemo.GenMemoNo, MDMemo.Message, MDMemo.Footer FROM MDMemo INNER JOIN CustInfo ON MDMemo.CustNo = CustInfo.CustNo WHERE  "
         + "  MDMemo.MemoNo LIKE '%" + search_parameter + "%' OR CustInfo.CompName LIKE '%" + search_parameter + "%' AND (MDMemo.MemoType = 'Concession')";
     OutRightDataSource.DataBind();
 }
開發者ID:DennisPitallano,項目名稱:IRMS-MARKETING,代碼行數:6,代碼來源:ConcessionMarkDownMemoManager.cs

示例14: SearchCustomerReturnSlipWithDateRange

 public void SearchCustomerReturnSlipWithDateRange(SqlDataSource DataSource, string PostedStatus, string search_parameter, DateTime date_from, DateTime date_to)
 {
     string CommandText = string.Empty;
     CommandText = "SELECT [ID], [CRSID], [CRSNo], [CRSDate], [Customer], [PUSNo], [TotalAmt], [PkgNo], [ItemStatus] FROM [CRS] ";
     CommandText += " WHERE CRSDate BETWEEN '" + date_from + "' AND '" + date_to + "' ";
     if (PostedStatus != "CONFIRMED")
     {
         if (search_parameter != string.Empty)
         {
             CommandText += " AND CRSNo LIKE '%" + search_parameter + "%' OR  Customer LIKE '%" + search_parameter + "%' ";
             if (PostedStatus == "POSTED")
             {
                 CommandText += " AND ynPosted=1 AND ynCancelled=0";
             }
             else
             {
                 CommandText += " AND ynPosted=0 AND ynCancelled=0 ";
             }
         }
         else
         {
             if (PostedStatus == "POSTED")
             {
                 CommandText += " AND ynPosted=1 AND ynCancelled=0 ";
             }
             else
             {
                 CommandText += " AND ynPosted=0 AND ynCancelled=0 ";
             }
         }
     }
     else
     {
         if (search_parameter != string.Empty)
         {
             CommandText += " AND CRSNo LIKE '%" + search_parameter + "%' OR  Customer LIKE '%" + search_parameter + "%' ";
             CommandText += " AND ynCancelled=1";
         }
         else
         {
             CommandText += " AND ynCancelled=1";
         }
     }
     DataSource.SelectCommand = CommandText;
     DataSource.DataBind();
 }
開發者ID:DennisPitallano,項目名稱:IRMS-WAREHOUSE,代碼行數:46,代碼來源:CustomerReturnSlipManager.cs

示例15: SearchDeliveryReceiptList

 public void SearchDeliveryReceiptList(SqlDataSource datasource, string search_parameter)
 {
     string CommandText = string.Empty;
     CommandText = "SELECT [ID], [DRNo], [DRDate], [PLNo], [CustNo], [DeliveredTo], [CustAddr], [TotalQty], [TotalAmt], [ItemStatus] FROM [DR] ";
     CommandText += " WHERE DRNo LIKE '%" + search_parameter + "%' ORDER BY DRDate DESC ";//OR ID LIKE '%"+ search_parameter+"%'";
     datasource.SelectCommand = CommandText;
     datasource.DataBind();
 }
開發者ID:DennisPitallano,項目名稱:IRMS-WAREHOUSE,代碼行數:8,代碼來源:DeliveryReceiptManager.cs


注:本文中的System.Web.UI.WebControls.SqlDataSource.DataBind方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。