sqldatasource

ora-00972 identifier is too long oracle 10g

那年仲夏 提交于 2019-12-10 23:17:09
问题 I am getting the error mentioned in the title. I am using a 36 charecter ID. This error is only thrown In my sqldatasource in my asp.net webform. It is not a problem when I perform updates in Oracle sql developer . How can I fix this? 回答1: Oracle supports an identifier with at most 30 characters and your identifier length 36 is greater than that.so make it 30 character in length. see this link 回答2: If you are successfully executing DML (UPDATE tableName SET ...) from another environment such

Adding ControlParameter to SqlDataSource prevents query and databinding?

六眼飞鱼酱① 提交于 2019-12-10 14:46:22
问题 I have a SqlDataSource that calls a stored procedure and it works fine. If I add a <ControlParameter> tag to add an additional argument, then the query never fires and the databinding never occurs. Suggestions? This works : <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultDB %>" SelectCommand="SP_WHATEVER" SelectCommandType="StoredProcedure" UpdateCommand="SP_WHATEVER2" UpdateCommandType="StoredProcedure"> <SelectParameters> <asp

Clear cache in SqlDataSource

戏子无情 提交于 2019-12-10 12:34:54
问题 I need to manually clear the cache on a SqlDataSource with caching enabled. I've tried setting EnableChaching = false, and CacheDuration = 0 (as well as = 1) and none seem to expire the content already in the cache - although they do seem to prevent new SELECTs from being cached. How do I manually expire that cache? Thanks. 回答1: I just started researching this today and came across this post, this look likes the best solution: Simple way to invalidate SqlDataSource cache programmatically <asp

Dynamic WHERE clauses in a SqlDataSource

坚强是说给别人听的谎言 提交于 2019-12-10 09:43:20
问题 I'm using a SqlDataSource in a very simple application. I'm allowing the user to set several search parameters for the SDS's select command via TextBoxes, one TextBox per parameter (think txtFirstName, txtLastName, etc). I'm planning on using a button click event handler to set the SqlDataSource's SelectCommand property which by default will return all records (for my purposes here). I want to refine this select command to possibly add one or more WHERE clauses depending on if the user enters

asp:QueryStringParameter and empty query string parameter

末鹿安然 提交于 2019-12-10 03:03:59
问题 I have asp:GridView displaying client requests using asp:SqlDataSource . I want to limit displayed information by client: View.aspx has to display everything, View.aspx?client=1 has to display only requests from client ID #1. So I'm using <asp:QueryStringParameter Name="client" QueryStringField="client" /> for query "EXEC getRequests @client" . Everything works properly when some client is specified. But don't - if not. I tested my SP using SSMS - it works properly in both cases - when

SqlDataSource SelectCommand using LIKE does not work

本小妞迷上赌 提交于 2019-12-09 13:58:01
问题 I have the following T-SQL in a SelectCommand : SELECT h.Business, hrl.frn FROM registration hrl INNER JOIN holder h on h.call = hrl.call WHERE (h.Business like '%' + @business + '%' and h.Business is not null) and (hrl.frn = @frn and hrl.frn is not null) business and frn are tied to control parameters and it should return data even if one or both is left blank, but if I put in data just for frn for example, it does not return anything. I think my T-SQL is not doing the right thing and I am

Intercept connection pooling of Datasource connections in JEE container

浪子不回头ぞ 提交于 2019-12-08 14:46:14
问题 is it possible to intercept the connection pooling mechanism of a DataSource in a JEE container? For (un)setting some information on the connection's context I'm searching for a way to intercept the pooling mechanism so that I know when and which connection is put back into the pool. So does anyone know a (common) way to do this? Some additional info: The application runs on Wildfly Using Hibernate for ORM 回答1: The option connection-listener in datasource configuration can be the solution.

Rebind gridview using AJAX (without post back)

末鹿安然 提交于 2019-12-08 09:41:44
问题 I plan on allowing a user to open a modalpopupextender containing a gridview witha Filter text box. I want it so when the user types in a filter, the filter is applied to the gridview and the contents of the gridview is then updated to reflect the applied filter - all without posting back. Also ideally the gridview will be filtered as he user types, rather than having to press a button. I'm guessing it would utilise FilterParameters on my SqlDataSource and an UpdatePanel, but can anyone offer

How to add Item to SqlDataSource databound list

泄露秘密 提交于 2019-12-06 10:20:54
I am lazy - and I am using a SQLDataSource to populate my dropdownLists. The Databind event for the databound objects is called before the Page.PreRender so I am doing something like this in the PreRender eventHandler: private void InitializeDropDown() { this.myDropDown.Items.Insert(0, new ListItem("-- Select something --")); } I know I can set AppendDataBound items to true and hardcode my custom item in the markup but before reverting to that I'd like to understand why what I am doing is not working. It usually works when I bind stuff dynamically like this: myDropDown.DataTextField =

Setting DateTime as a SqlDataSource parameter for Gridview

守給你的承諾、 提交于 2019-12-06 07:40:57
问题 Hey I would like to display certain data with my stored procedure for the last 30 days. here is what I have done (aspx.cs file): protected void Page_Load(object sender, EventArgs e) { DateTime toDate, fromDate; toDate = DateTime.Now; fromDate = toDate.Subtract(new TimeSpan(31, 0, 0, 0)); SqlDataSource1.SelectParameters.Add("fromDate", DbType.DateTime, fromDate.ToString()); SqlDataSource1.SelectParameters.Add("toDate", DbType.DateTime, toDate.ToString()); } here is my aspx file <form id="form1