DataSource Controls :: When Select Data Source In Some Controls (ex. RadioButtonList)?
Jun 23, 2010I have problem with SQL CE. SqlDataSource configuration looks good - query test is ok but - that is error.I added
[Code]....
I have problem with SQL CE. SqlDataSource configuration looks good - query test is ok but - that is error.I added
[Code]....
On my web form, I have a RadioButtonList as follows:
Select a radio button when page loads based on RadioButtonList's DataSource
I use below code for binding CheckBox from database
if (_dr["Radiator"] != null && _dr["Radiator"].ToString() != "") {
RDBSH.Checked = true;
}
I want bind RadioButtonList from database like above how I can do it?
<asp:RadioButtonList ID="RBL1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="North" Value="North"></asp:ListItem>
<asp:ListItem Text="South" Value="South"></asp:ListItem>
</asp:RadioButtonList>
I have extended GridView in order to have consistent look & feel, paging and sorting. However, when the page is first time loaded, the select method is getting called twice. It works fine when i move between pages in pagination.
Note, i am using Asp.net 2.0.
I have a GridView and a FormView on the same page. They both have separate DataSources. This is a simple Master Details configuration, when a someone clicks on the Select link in the GridView, the FormView brings up the Details data. But for some reason the FormView's DataSource is trying to retrieve data when I load the page. This is causing an error because no ID is passed from the GridView.
View 16 RepliesI'm new to this community and got newbie question, briefly in data access in asp.net what is the difference between accessing dataset using typed Dataset and using data sources controls like SQL data source control ...? As I noticed that using data source controls is much easier, but it allows only one data access method i.e. only one query... am I right with that....
View 1 RepliesI have a radiobuttonlist inside a datalist itemtemplate and i need to bind the radiobuttonlist dynamically from database I have tried to bind it inside itemdatabound event of datalist but it the result is always duplicated according to the fields in teh database.
for more information:
the database has two columns one for questions and the other is for choices , for the first question with id lets say 1 there are 4 choices, when the radiobutton is binded the result appears to be 4 times duplicated ?
I am developing on application in that i have taken one list box and getting data to it using an object source.up to this stage it is fine.I need to compare these value what i get into list box and need to represent data in to a report viewer ..how to get these values from objectsource.i m new to c# i placing the code.
[Code]....
I am running:
Windows Server 2008
MS SQL Server 2008
MS SQL Server Native Client 2008
I need to create an ODBC Data Name Source. The instructions on microsoft site are not explicit enough.
I have an object data source that is being used by an rdlc report, and the object data source uses a filter that is built from session variables passed to the page.
The report displays correctly, with the filter applied; however, I want to mark each of the rows as "printed" in a bit field in the database table.
In the table adapter, I have the following Update command that is used by the object data source:
UPDATE dbo.WorkOrder
SET boolWorkOrderPrinted = 'True'
WHERE (WorkOrderID = @Original_WorkOrderID)
And in the Page Load event, I run:
ObjectDataSource1.Update();
However, no records are updated.
Iam using DETAILs VIEW TO insert data i have several controls inside Using sql datasouce to insert the data. How can i achieve this?
View 2 RepliesI have a SQLDataSource on an ASP.Net C# page. I want the ability to add a Control Parameter based on a DropDown List that will either display records that are either NULL or Not NULL In a Column. I have the following Code Snippet:
SelectCommand="SELECT [PATID], [LastName], [FirstName], [UIN], [Rate], [Account], [Project], [Supervisor], [HireDate], [Assistantship], [Hourly], [FundingStartDate], [FundingEndDate], [TerminationDate], [Citizenship], [TitleCode], [Email], [Notes],
[SupervisorUpdateEnabled], [SupervisorTargetSemesterCode], [PATCertDate] FROM [PATAccounts] WHERE TerminationDate @Terminated ORDER BY [LastName]"
i am a new user of asp.net and i am a learner so i just want to connect two dropdownlist to data souce and i want that the list item of second dropdown is changed according to change of selected item of first dropdown.
i have connect it to data source successfully it getting chaged items but it happance only when its load then if i select the next item of first one it would not work properly.
I know this sounds odd. I have a SQL DB that I am pulling data from. I have to some math functions to get a percentage. So I am pulling all the data in my code and building a data table with the results. I am then trying to pass this into a chart control that I have, but it fails because the data source is not correct for the chart control. I know that the chart control will accept a SQLDataSource control as a data source because a built a example with it before using it in my project.So my question is how can I use the Data Table as a data source for a SQLDataSource Control? Or is there a way I can pull the data from my DB andapply the math needed in a stored procedure or something similar that I could create the procedure on my SQL server then add a SQLDataSource control to my page and use the stored procedure as the source for the SQLDataSource Control.
View 5 Repliesmy query is SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.CO
FROM V_HIERARCHY1 a
my data is ,HR HR Rec Records Leave Leave Records HRL.0001 Policy and Process for leave record. 27.06.2010 30.06.2010 WIP Edlink
HR HR Rec Records Leave Leave Records HRL.0002 Quarterly Review 01.07.2010 04.07.2010 Planned Edlink
HR HR DB Database SAL Salary DDS.0001 Calculation of Monthly salary 08.08.2010 09.08.2010 WIP Edlink
HR HR Rec Records Ind Induction Records HRI.0001 Completion of dossiers. 08.07.2010 10.07.2010 WIP Edlink
HR HR DB Database Emp Employee HDE.0001 Offer letter 06.07.2010 09.07.2010 WIP Edlink
my outout is ,HR
REC
LEAVE
HR1
REC1
LEAVE1
I was looking at the options in Intellisense for the properties used with a parameter for the Object Data Source. There is one that I don't understand how it would be used. explain, or recommend an article, about the DB Type is for and how it would be used?
View 2 Repliesi had a requirement for dynamic sorting so i wanted to assign order by.. dynamically depending on what column is clicked for sorting
i tried to modify the sql data source command
in ds selecting event by using
e.command.CommandText=modifiedCommandHere; but it doesnt work as it always picks up selectCommand specified in aspx page
I have an insert that uses an object data source with out the direction property set and it works fine. I noticed the direction property though and wondered if I should use it.Should the direction property for the parameters of an object data source be used with a simple CRUD operations?
View 3 RepliesI'm trying to understand when to use the type property and when to use the dbtype property. I looked online but couldn't find a good article that said when and why.
View 3 Replieshow to delete child records in the first step
check if there is no more child using count row number if = 0 delete the key in parent table
parent table must have always child records in my case by Using sql data source Delete tab
When my page is first loaded i receive error message stating to the effect
cant find Email for GetInvoicesByVendor.
this refers to a function in another class file:
Public Shared Function GetInvoicesByVendor(ByVal Email As String, ByVal vendorid As Integer) _
As IEnumerable
yet i only want to execute this function during the button click event and not when page is first loaded with the following parameters:
vendorid.Text = 1
txtcustomerid.Text = test@yahoo.co.uk
My objectdatasource is declared as follows:
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetInvoicesByVendor" TypeName="InvoiceDB">
<SelectParameters>
<asp:ControlParameter ControlID="txtcustomerid" Name="Email"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="vendorid" Name="vendorid" PropertyName="Text"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
I want to call a method in the code behind file from the aspx file, but I can't get the TypeName propery correct.
I can call methods in the dll:s in the bin folder and from files in the app folder, but not from code behind in the aspx page. What do I need to do.
i'm working with visual studio 2005 c#
i have in one aspx page a gridView with a few of sqlDataSources ..
and i have in another page ,,, hyperlinks ... and i want that it will select a defrent datasorce each time i click on other link ....
I created a class library: PRTreatmentReviews. I created a reference for the class library on the website. I checked the property pages and the reference to the class is there. I put objectdatasource on a page and tried to pick up the PRTreatmentReviews class but it's not there? The Class
[Code]....
I got the following error message:
There was an error executing the query. Please check the syntax of hte the command and if present, the types and values of the parameters and ensure they are correct. Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
But when I run the query through Management Studio, I can get the result.
There are no parameters for this query either.