DataSource Controls :: Using Web Service With Object Datasource?
Mar 5, 2010
have an object datasource that calls a web method to retrieve a set of data. That web service resides on another remote server with Windows Authentication enforced. How do I pass in the credentials required for the authentication from my web application? My code is as follows:
[Code]....
View 7 Replies
Similar Messages:
Mar 10, 2011
i have problem white Object datasource. i have a multi-tier Application that include common layer ,DAL Layer,business logic and persantation layerwhen i add a object datasource to my page, it bring me only common layer classes . but i want use bisuiness layer classes what do i do ?
View 1 Replies
Oct 27, 2010
I am storing a custom "Organisation" object as a session variable. One of the properties of the Organisation object is "OrganisationID" (integer). I have a DataSource that requires a parameter value to run, and I want to use a SessionParameter to populate this. In a previous version, I stored the OrganisationID directly as a session variable. In that case, I could easily access it like this:
[Code]....
However, how do I now access the OrganisationID property of an "Organisation" type session variable (called "Organisation")? I have tried this, which does not seem to work: <asp:SessionParameter Name="OrganisationID" SessionField="Organisation.OrganisationID" Type="Int32" />
View 2 Replies
Aug 9, 2010
This is the first time I have been working on databases and I am trying to insert data using an object datasource but no data is being inserted and no exception is thrown. I'm not sure where I am going to wrong. I am putting user data into session variables and inserting the session variables into the dataacess class layer and have a try and exception but nothing being thrown. Any help would be really appreciated because I don't know even where to start looking with this or how I can get the error to be thrown. Please see some of my code below to give an idea of what I am doing
Object Access Class
public void InsertCarPolicyHolder(PolicyHolderClass ph, CarInsuranceOptions options)
{
[code]...
View 2 Replies
Jan 17, 2010
I have a Public Sub listed in a class file that I am using to store Select, Update,etc...methods for an Object Datasource. When I attempt to configure the datasource, the Class appears as a business object, but the sub within the class is not available for method selection. (It does not appear in drop down list in wizard.)
The sub exists, so where is a good place for me to start looking for a fix? I have part of the class file listed below:
[Code]....
View 7 Replies
Apr 20, 2010
im tryin to create a login form.
and am receiving the following error:
Object reference not set to an instance of an object
[Code]....
and heres my aspx page:
[Code]....
Stored procedure:
[Code]....
View 2 Replies
Feb 17, 2010
On DBML I have two entities as Parent, Child. I am trying to assign Child class properites in a Parent.
[code]....
I am getting the following Error:
Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.
View 2 Replies
Jul 27, 2010
[code]....
i'm having trouble because when it has no return value i get the error
Object reference not set to an instance of an object.
View 10 Replies
Jan 24, 2010
im using a sqldatasource and i want it to query a table chosen from a dropdownlist, so i wrote the following in the .cs file
[Code]....
im recieving this error msg: Object reference not set to an instance of an object (pointing to the line containing the select command)
i don't know what's the problem, i tired a hard-coded statement and it worked fine!
View 2 Replies
May 26, 2010
I am adding rows to table and setting value row/cell value, but for datetime field it is giving me error
Object reference not set to an instance of an object.
Initially I am adding a column to table as
table.Columns.Add("Upload Date",
typeof(DateTime));
Then I assigning value to row as
row["UploadDate"] = result["Execution Date"].ToString();
As I have I also null or empty value in the "Execution Date" field .
View 3 Replies
May 3, 2010
Traditionally with an Object Data Source, the wired up class will have its public properties available for binding (i.e. Gridview columns, etc.) which works well. But what if one of my wired up business objects has a property that is an object itself; can I drill down to a property on that object property and still use it?
So in additiona to the traditional:MyBusniessObject.OrderID...I want to use:MyBusniessObject.Customer.NameID
Your 1st response might be to just wire up the 'Customer' class, but I need properties both on 'MyBusinessObject'and 'Customer'. I do not think this can be done, as the ODS will not display properties on an object instance property. I have tried manually typing in the drilled down value as well, but that wasn't a success either.
View 4 Replies
Aug 25, 2010
I'm getting the old "Object reference not set to an instance of an object" error on this code:
nonqueryCommand.Parameters.Add("@comment", SqlDbType.VarChar, 500)
nonqueryCommand.Parameters("@comment").Value = CType(FormView1.Row.FindControl("CommentsLabel"), TextBox).Text
"CommentsLabel" is a textbox, despite it's name (and I've tried the CTYPE ot Label too).
View 3 Replies
Jun 22, 2010
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]....
View 1 Replies
Jul 20, 2010
I am trying to get an asp:SessionParameter of a SelectParameters, to use a property of an object in session
instead of having a string in the session like Session["CustomerID"]
Something like Session["Customer"] where the property is ((Customer) Session["Customer"]).CustomerID)
My code:
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:DBConnectionString %>" xmlns:asp="#unknown"> SelectCommand="SELECT * FROM getStoreCustomers (@customerID,@week,@day)"
ProviderName="System.Data.SqlClient">
<selectparameters>
<asp:sessionparameter name="customerID" sessionfield="Customer" /> ?????? (what is the syntax to pass the property here?)
<asp:controlparameter controlid="ddWeek" defaultvalue="-1" name="week" propertyname="SelectedValue" /> <asp:controlparameter controlid="ddDay" defaultvalue="-1" name="day" propertyname="SelectedValue" /> </selectparameters>
The class I use is like any other class (but serializable)
[Serializable]
public class Customer
{
public int CustomerID
{
get;
set;
}
}
View 2 Replies
May 18, 2010
I have created my function as follows
USE [fedach]
GO
/****** Object: UserDefinedFunction [dbo].[pages_Allowed] Script Date: 05/18/2010 14:14:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[pages_Allowed] (@username varchar(35))
RETURNS varchar(30) AS BEGIN -- Declare the return variable here DECLARE @pages varchar(30)
DECLARE @PRvalidate tinyint,@PRdownload tinyint,@PRupload tinyint, @Pages as varchar(35)
select @PRvalidate=Rvalidate,@PRdownload=Rdownload,@PRupload=Rupload from tblPermittedpages where Username=@username;
select @Pages = case
when @PRvalidate=1 and @PRdownload=1 and @PRupload=1
then 'Admin'
when @PRvalidate=1 and @PRdownload=0 and @PRupload=0
then 'Validate Only'
when @PRvalidate=0 and @PRdownload=1 and @PRupload=0
then 'Download Only'
when @PRvalidate=1 and @PRdownload=0 and @PRupload=0
then 'Validate and Download' End;
return @pages
END
But when i am running the function i am getting the error as Invalid object name 'dbo.pages_Allowed'. can any one tell why?
View 7 Replies
Feb 5, 2010
I have a table into the database. Table name is NewResults. I have created instance of NewResult called result and fill it with all the infos i need. Now when I try to add i dont have add method in
context.NewResults. -> no Add here. So if i enter context.NewResults.Add(result) error as below is shown:
Error 1 'System.Data.Linq.Table<UDWAutoLinqTry.LinqToSql.NewResult>' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'System.Data.Linq.Table<UDWAutoLinqTry.LinqToSql.NewResult>' could be found
(are you missing a using directive or an assembly reference?) C:Documents and SettingsAlek.NikolovskiMy DocumentsVisual Studio 2008ProjectsUDWAutoLinqTryUDWAutoLinqTryCompareCompareHelper.cs 332 32 UDWAutoLinqTry
what am i missing?
I know that i dont have to create add method myself i was googling and i am doing everything as it should but still no luck?
View 3 Replies
May 31, 2010
i am trying to create an asp.net service where it can delete specific records from the databas, this is by code so far:
[Code]....
this is the error i am getting
[Code]....
the code that it refers to by line 134 is myDataAdapter.Fill(delds, "comments"); so i guest is somthing to do with the .fill
View 15 Replies
Jun 2, 2010
Need ideas on how to do this. I have a page where I'm adding a new object.This is a row in a db table. This object has a list of other objects associated with it.I want to be able to define the sub-objects before adding the new object. Does that even make sense??
I was thinking somehow using the object datasource would be a good way to manage this. That way when I add the object, just loop through the object datasource to get the sub-objects to add. How would I achieve this with the object datasource, or am I even going about it the right way?
View 5 Replies
May 19, 2010
I have a data object named Usertype. The Database table is also called Usertype. I need to have an enum representing Usertypes also. What would proper naming convention be for the Usertype Enum? It can't be Usertype. But I can't append an E or "Enum" to it anywhere. What would be the proper name for the Enum?
View 3 Replies
Jan 4, 2010
what is the best to close or dispose all the ado.net object
eg:datareader.close(); or sqlcommand.Dispose();
if programs hangs in the middle(because of error), then how to close all the ado.net object so there will be no memory leak
View 5 Replies
Jan 22, 2010
I have a Windows 2003 test server hosting an asp.net 2.0 application and Sql Server 2005 running as Sql Server 2000(80).During a recent a security review we decided that it wasn't such a hot idea to use sql authentication with an sysadm user as the database user for the asp.net application. Having done a bit of reading (http://msdn.microsoft.com/en-us/library/ms998258.aspx#pagguidelines0001_dataaccess) I decided to use a lower privilege database user account and windows authentication.Starting from scratch I created a new custom service account (http://msdn.microsoft.com/en-us/library/ms998297.aspx) and assigned this to the process identity for the application pool.I then created a new database login and user for this account. I added the db_datareader and db_datawriter roles to this user and I also granted EXECUTE permissions for user defined stored procedure and functions. However when I started the application I got this error 'User does not have permission to perform this action.Cannot find the object 'AspNet_SqlCachePollingStoredProcedure', because it does not exist or you do not have permission.' - after a quick hunt I found thishttp://forums.asp.net/p/1487216/3493362.aspx and followed the advice herehttp://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependencyadmin.aspx and granted the user CREATE TABLE and CREATE PROCEDURE permissions.Still no joy - after digging around and looking at sql profiler I found what I believe to be the offending piece of sql:
/* Create notification table */
...sql
/* Create polling SP */
..more sql
..finally
GRANT EXECUTE ON dbo.AspNet_SqlCachePollingStoredProcedure to aspnet_ChangeNotification_ReceiveNotificationsOnlyAccess
My understanding is that to issue 'GRANT EXECUTE' the user must db_owner or db_secadmin. Indeed it all works fine if I give the service account user login the db_owner role.This sql is caused by: SqlCacheDependencyAdmin.EnableNotifications(ConnectionString), this is called once and once only by the application start event.Is there a work around for this? I would like to use the lower privilege account as per best practice but this issue is making it tricky.
View 4 Replies
Jan 7, 2010
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.
View 1 Replies
Feb 17, 2010
I've created my dataset in my App_Code folder. I tested it so it works, But then when I add in my page an ObjectDataSource, it can find any object the list is empty. I looked for online some solution but I didn't find something which worked. It works when I add the code manually, but i would like to understand how come, which part I misunderstood.
[Code]....
View 6 Replies
May 31, 2010
i have one ajax accordion control and inside that i have a list view inside that control. now listview is bind to objectdatasourcecontrol.
and object data soruce control is bind to a custom class. Now the problem is that i need to naviagate to different pages on the click of the listview items or load user control...Now how to do that?. i am pasting my code here.
[Code]....
and class file which is bind to objectdatasource control
[Code]....
View 4 Replies
Feb 15, 2010
I've a listview where in am using object datasource to bind the data.I've few questions with the object datasource. Will object datasource load the page twice?Also is there any way to stop listview autobind with object datasource i.e i want the listview binding to be controlled by code behind. Now i see i cant control the listview binding on page load.. object datasource is taking care of that?The problem i'm facing is that am getting my control coming to page load twice.
View 3 Replies