sqldatasource

SqlDatasource select parameters

我是研究僧i 提交于 2020-01-03 03:14:29
问题 Here is my sql datasource details <asp:SqlDataSource ID="dsMoodleQuiz" runat="server" ConnectionString="<%$ ConnectionStrings:OnlineMeetingConnectionString %>" ProviderName="<%$ ConnectionStrings:OnlineMeetingConnectionString.ProviderName %>" SelectCommand="SELECT Name, UserID, Grade, FirstName, LastName, Email, TimeModified, IDNumber FROM tbMoodleQuiz WHERE (FirstName = @FirstName) AND (LastName = @LastName)" onselecting="dsMoodleQuiz_Selecting"> <SelectParameters> <asp:Parameter Name=

asp:SqlDataSource to DataSet Items

只愿长相守 提交于 2020-01-02 17:48:31
问题 I have an asp:SqlDataSource ID="SqlDataSource1" tool on my aspx page, what I want to do in the c# sharp code behind is transfer the records returned by the datasource and put them into a DataSet, so that I can add paging to my page, how do I do that, my attempts so far have failed?! My attempts so far have been along the lines of: DataSet Items = new DataSet(); Items = SqlDataSource1.Data(); But the error I am getting is that the SqlDataSource1 control is not accessible in this context and so

asp:SqlDataSource to DataSet Items

浪尽此生 提交于 2020-01-02 17:48:08
问题 I have an asp:SqlDataSource ID="SqlDataSource1" tool on my aspx page, what I want to do in the c# sharp code behind is transfer the records returned by the datasource and put them into a DataSet, so that I can add paging to my page, how do I do that, my attempts so far have failed?! My attempts so far have been along the lines of: DataSet Items = new DataSet(); Items = SqlDataSource1.Data(); But the error I am getting is that the SqlDataSource1 control is not accessible in this context and so

Getting 'too many parameters passed' to stored procedure on ASPX page

故事扮演 提交于 2020-01-02 11:05:38
问题 I'm having trouble figuring this error out. I have a grid on an ASPX page that displays data from a stored procedure in an SQL Server 2008 database. When the page loads, I get the following error: "Procedure or function <sp_name> has too many arguments specified." Here is the code for the grid and the datasource: <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" ShowFooter="True" OnRowDataBound="GridView1_RowDataBound"

How to clear exisiting dropdownlist items when its content changes?

送分小仙女□ 提交于 2019-12-31 21:42:35
问题 ddl2 populates based on ddl1 selected value successfully. My issue is the data that is already present in ddl2 does not clear before appending the new data so ddl2 content just continues to grow every time ddl1 is changed. <asp:DropDownList ID="ddl1" RunAt="Server" DataSourceID="sql1" DataValueField="ID1" DataTextField="Name2" AppendDataBoundItems="True" AutoPostBack="True"> <asp:ListItem Text="ALL" Selected="True" Value="0"/> </asp:DropDownList> <asp:DropDownList ID="ddl2" RunAt="Server"

How to get sqlserver database name from datasource name in Java

戏子无情 提交于 2019-12-31 05:39:05
问题 As specified in the title, I want to get the database name in sqlserver, all info I know is datasource name, login name/password to get the Connection object, please show some pointers on how to retrieve the database name correctly, in java, thanks! Even 回答1: Obtain an instance of java.sql.DatabaseMetaData from the connection object. The names of database can be obtained via getCatalogs() or getSchemas() method (It depends upon the vendor of JDBC driver). ResultSet rs=cn.getMetaData()

Make an ASP.NET GridView change based on a DropDownList selection

别说谁变了你拦得住时间么 提交于 2019-12-25 03:40:26
问题 I've tried a thousand ways to make this work and I can't. I have a DropDownList bound to the data in a column from an .mdf database. I also have a GridView below it that is bound using the Query Builder to columns from 4 different tables in that same database. I know to do this you have to add a WHERE clause to the query string that looks something like this -- WHERE ([column] = @column) -- And then you have to put a SelectParameters in the HTML code. But I don't know how to write it

How to access the bound DataSource item in the ASP.NET ListView's DataBound event?

拥有回忆 提交于 2019-12-25 01:47:21
问题 I know the question has already been posted here but we didn't get to an real solution. I have bound my ListView to an SqlDataSource and I want to write some text in a control present in the view created in the LayoutTemplate depending on some properties of the rows returned. Obviously, I'm using the ItemDataBound event to feed my items but this is not the point. The spontaneous solution was to bind the ListView.DataBound event and access the raw datasource (a DataTable?) and do the required

Connecting 2 dropDownLists with SqlDataSource FilterExpression inside ASP:Repeater

↘锁芯ラ 提交于 2019-12-24 22:44:59
问题 Using 2 dropDownLists in repeater row how does one use the 1st one as a filter for 2nd? The repeater layout is simple: [category_dropDown][item_dropDown][add_button] The problem is that I can't connect two dropDown controls. SqlDataSource ControlParameter cannot find ControlID to call (controls renamed by repeater). Changing ControlID value to "itemRepeater$dropDownCategory" obviously doesn't help. How do I bind these dropDowns to work in pairs? Wondering mostly if there is a markup code

SQLDataSource Insert method not working in CodeBehind .NET C#

自作多情 提交于 2019-12-24 10:57:21
问题 I'm writing an ASP web project for a degree module and I have to insert some login details into a login table. It was working fine whilst I had it running as a script in the .aspx file, but I needed to hash the password so, not knowing a way to do it outside the Code Behind file, I moved the SQLDataSource. This is the insert, which doesn't work. SqlDataSource sqldsInsertPassword = new SqlDataSource(); sqldsInsertPassword.ConnectionString = ConfigurationManager.ConnectionStrings[