DataSource Controls :: Failed To Work With The RetrieveData() Function ?
Jan 26, 2010
I've never used the RetrieveData() function and I don't know much about it.Having failed to work it out myself could someone show me some examples of how I call this method?Here's what I know about it:
1.It hadles the work of contacting the database and creating the DataSet.2. You must import System.Data, System.Data.SqlClient and System.Web.Configuration namespaces in teh web page.3. It can be called in any event handler in the web page code.I've tried typing this method in my page_Load() but I get the squiggly red underline which indicates that it doesn't recognise this method.
View 2 Replies
Similar Messages:
Jan 27, 2010
I got a gridview to display the data from the database properly but when I go edit. it give me an error. I searched and change ConflictDetection=CompareAllValues to OverwriteChanges
The error goes away. However the database is still doesn't update. Does anyone had to tweak the gridview function to make it works. Maybe I did something wrong.
View 1 Replies
Mar 20, 2010
I have a simple query on a table to calculate the sum of a field (This field is a calculated field from within SQL 2005)SELECT SUM(RunTime) AS TotaL FROM TimeSheets.It errors out with: Error Message: Operand data char type char is invalid for sum operator.If I use the MAX or MIN function, no isssues. The data in this field is numeric.
View 4 Replies
May 16, 2010
I am using SQLEXPRESS 2008 R2 and developing ASP.net 4 application. I am getting this error:
Cannot open database "mydbfile" requested by the login. The login failed.
Login failed for user 'IIS APPPOOLASP.NET v4.0'.
View 6 Replies
Nov 8, 2010
I have a gridview with several ItemTemplates. The first contains a checkbox the rest contain textboxes. I then added dynamically some bound controls like this:
BoundField bdfPrivName = new BoundField();
clsUtilities.SetBoundFieldCenter(ref bdfPrivName, "PrivName", "Priv Name");
BoundField bdfDescription = new BoundField();
clsUtilities.SetBoundFieldLeft(ref bdfDescription, "PrivDesc", "Description");
BoundField bdfLive = new BoundField();
clsUtilities.SetBoundFieldCenter(ref bdfLive, "Live","Active?");
grdExisting.Columns.Add(bdfPrivName);
grdExisting.Columns.Add(bdfDescription);
grdExisting.Columns.Add(bdfLive);
I then use FindControl to locate the checkbox and textboxes and perform my logic based the result
foreach (GridViewRow gvr in grdMissing.Rows) {
mckbAny = (CheckBox)gvr.FindControl("ckbAdd");
mtxtApplyDate = (TextBox)gvr.FindControl("txtAddApplyDate");
mtxtDateToAdd = (TextBox)gvr.FindControl("txtAddDateToAdd");
mtxtDateToRemove = (TextBox)gvr.FindControl("txtAddDateToRemove");
etc.
This all worked fine. I then got a request to put the bound fields as the second, third and fourth columns, after the check box and before the textboxes. I found that this was easy to do by changing the Add's to Inserts as follows:
grdExisting.Columns.Insert(1, bdfPrivName);
grdExisting.Columns.Insert(2, bdfDescription);
grdExisting.Columns.Insert(3, bdfLive);
It looked fine of the page, but the FindControls, all of them fail to work.
View 5 Replies
Apr 25, 2010
how can i use cursor in this function ?
ALTER FUNCTION [dbo].[GetCatIDChilds]
(
@CatID [code].....
View 1 Replies
Apr 15, 2010
I am currently trying to connect to a local aspx page that is stored on one of the internal servers. When I try to connect to the page I get the following error. Would someone be able to assist me with this issue?
It is running on SQL SERVER 2008 (not express)
I am using the following connection string in the Web.Config file
sessionState
allowCustomSqlDatabase="true"
mode="SQLServer"
sqlConnectionString="server=ORCHID;database=122119-01;uid=ORCHIDIUSR_ORCHID;pwd="
cookieless="true"
timeout="120"
/>
Probem:
Server Error in '/' Application.
Failed to login to session state SQL server for user 'ORCHIDIUSR_ORCHID'.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Failed to login to session state SQL server for user 'ORCHIDIUSR_ORCHID'.
Source Error:
[Code]....
Stack Trace:
[Code]....
[SqlException (0x80131904): Login failed for user 'ORCHIDIUSR_ORCHID'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo) +93
[HttpException (0x80004005): Failed to login to session state SQL server for user 'ORCHIDIUSR_ORCHID'.]
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
View 3 Replies
Jan 13, 2010
I got a simple SQL Connection which works fine under VS 2005, once I convert to VS 2008, is failed to work. I even re-build entire apps from scratch under VS 2008, yet it still failed.
Here's the code.
[Code]....
The code failed at this line:
objCon = New SqlConnection()
Error message being:
The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
View 4 Replies
Feb 11, 2010
I have SQL 2005 with SP3 installed. I created a maintence paln using the wizard. When I execute it, I get an error message 'MaintenancePlan.Subplan1 failed.
View 2 Replies
Jun 30, 2010
I was working on a asp.net project earlier but due to some OS problem I had to re-install the OS..so before re-installing the OS I detached my sql database and then attached it back after installation..but I am having a login problem now..the previous servername was XYZ-DB840C74SQLEXPRESS..so this user i.e. XYZ-DB840C74ASPNET is added to the database's permissions..now my new server name is XYZ-8D50FD73SQLEXPRESS..but I am unable to add this user through the permissions wizard..I am getting the following error: Cannot open database "finance" requested by the login. The login failed. Login failed for user 'XYZ-8D50FD73ASPNET'.
View 7 Replies
Mar 12, 2010
my web-app working well locally, but since i uploaded it and my DB, i keep receiving this Error :
Login failed for user 'XXXXX'.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'XXXX'.
Source Error:
[Code]....
Stack Trace:
[Code]....
[SqlException (0x80131904): Login failed for user 'XXXXX'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 news.dg_bind() +95 news.Page_Load(Object sender, EventArgs e) +5 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
I checked my Username , Password and its Permissions for thousands time, and everything seems to be alright. I developed the Website by ASP.Net / C# (VS2008) and SQLServer2008 and I guess the problem is with ConnectionString, below you can find my ConnectionString:
Server=(local)SQLEXPRESS;User ID=myusername;password=mypass;Database=mydb;Persist Security Info=True
View 5 Replies
Oct 30, 2010
I have a code block that contains around 320 lines of code. Everything runs fine when i debug it until i reach the section that updates a sql datasource. I am using:
sqlDScc.UpdateParameters("friendlyName").DefaultValue = friendlyName
I have 38 lines of update parameters before i call the sqldscc.Update When i put a break point before the update parameters all the values are correct at the break point at the end all the values are "Property Valuation Failed"?. I'm not using any response.end, response.redirect or server.transfer
[Code]....
View 3 Replies
May 24, 2010
wen is tried to save ma value in DB the following error is poppin out..Login failed for user 'DomaniUsername.Code:
using System;
using System.Collections;
using System.Configuration;
[code]...
View 1 Replies
Jan 28, 2010
I have 3 virtual computers (Windows 2003); domain server, database server(name=SQL2000), application server(name=2003APPSERVER).SQL2000 is hosting Sql Server 2000, in mixed authentication mode 2003APPSERVER is hosting IIS 6 and asp.net 2.0 Both servers are in the same domain - IAW The application pool (for the asp.net application) in IIS is operating under the 'Network Service' identity.I have created a new login to the database - 'IAW2003APPSERVER$' (see -
http://msdn.microsoft.com/en-us/library/ms998320.aspx#paght000015_sqlserver).I have assigned this login as a user in the 'demo' database with the db_owner role.I can connect from my asp.net application using an sql login and credentials (different account [obviously]).But when I use this connection string I get "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection".
connectionString="Initial Catalog=demo;Data Source=SQL2000;Integrated Security=SSPI;"
Having done some reading including here
http://support.microsoft.com/kb/889615 and here http://forums.asp.net/t/1140981.aspx. I cannot see what I am doing wrong.SQL server authentication is set to mixed I am connecting (or trying to) to a windows user not an SQL server login The user has sufficient privileges in the database.
View 4 Replies
Jun 8, 2010
I am writing a page for creating a new user for a website. After the user fills out the form and click the "Create User" button, the information provided is supposed to be sent for storage to the database. I have been getting the same error message for a couple of days now and I've ran out of things to try. The message doesn't seem like a complicated issue, in fact it's quite common and found a great deal of information on how to resolve it. However, nothing I've tried works. I'm using VS 2010, and SQL Server Express 2005. The message I get is the following:Cannot open database "[database]" requested by the login. The login failed.Login failed for user "[MACHINE_NAMEUSER]".I have added my current Windows account to the Users folder under the Security folder through Management Studio and granted it all the role memberships. I'm also using Windows authentication. If there's any information I'm not providing to figure out what's the issue, let me know and I'll post it.Stack Trace:
[Code]....
View 3 Replies
Jul 22, 2010
The pages on my project are base on master and content pages...
I want to do something with javascript(rather than jquery) in one of content pages after ALL OF MASTER AND CONTENT ELEMENTS ARE LOADED COMPLETELY.(for example set focus on a RadComboBox Control)
For doing that I used the below code :
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript"> [code]...
But alert(combo); always returns null.(the $find code is for telerik controls and the upper codes about telerik controls are completely true)To solve this null problem I test the ways shown below:
1-I Removed all of controls from master and content page except RadComboBox Control and null problem disappeared , so i derived the null peoblem is about all of elements of master and content page have not been loaded when
$find("<%= RadcbPersonelCompleteNameInvwNoskhehEdit.ClientID %>"); is fired.
2-so i used $(document).ready(function() { my codes }); instead of onload = onloadOfDocument;
3-at last i test the below code and it works perfectly :
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> [code]...
What function of document should i use for doing some javascript codes after all Of MASTER AND CONTENT ELEMENTS are loaded completely?
View 1 Replies
Jan 10, 2011
I swear I'm overthinking this as I've tried different combinations to do an insert from Code Behind to my Sql DB.
This is what my table looks like:
[Code]....
My code behind:
[Code]....
I suspect that the problem may be my date. The format that goes from the UI is mm/dd/yyyy.
View 2 Replies
Jun 3, 2010
I am trying to get the 'userid' of the logged in user using the code below:
"MembershipUser myObject = Membership.GetUser();
String userId = myObject.ProviderUserKey.ToString();"
and later using it as a parameter to the stored procedure.
The logic here is, the user should login first in order to retrieve his/her album. when the user is logged in, im retrieving the 'userid' and using it as parameter to load the corresponding album from the database.
when i login and open the albumpage, im end up with this exception:
"Failed to convert parameter value from a String to a Guid".
What could be the reason and how can i avoid this exception.
by the way im using the aspnet_Users table's userid field.
View 7 Replies
Mar 17, 2011
I have an application build using asp.net in sharepoint platform, however the paging and sorting features in gridview failed to function properly in Offline Explorer (Metaproduct) environment, an offline browsing software.
View 1 Replies
Jan 13, 2010
Using the following quires, for select and Update,. Select qry is working fine ,but update qry throws 'conversion failed when converting datetime from character string' .
select * from table1 where CreatedDt >= convert(datetime,'12/23/2009',101) and createdDt < dateadd(d,1,convert(datetime,'12/23/2009',101))
Update Table1 set status = 'y' where CreatedDt>= convert(datetime,'12/23/2009',101) and CreatedDt < dateadd(d,1,convert(datetime,'12/23/2009',101)
View 2 Replies
Feb 16, 2010
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[SP_ORDER_LIST]
@EmailId nvarchar(50)
AS
begin
declare @Id int
set @Id = (select SellerId from cart_seller_master where EmailId = @EmailId )
select
CTD.OrderId,CTD.Product_code,
CPM.product_name,CTD.Quantity,CTD.Orderdate,
case when convert(datetime,isnull(CTD.DispatchedDate,null)) is null then 'Not Dispatched'
end DispatchedDate ,
case when convert(datetime,isnull(CTD.DeliveryDate,null)) is null then 'Not Dispatched'
end DeliveryDate
from cart_Product_master as CPM
left outer join cart_Transaction_details as CTD on ctd.product_code=cpm.product_code
where CPM.SellerId = 1
group by CTD.OrderId,CTD.Product_code,
CPM.product_name,CTD.Quantity,CTD.Orderdate,
CTD.DispatchedDate,CTD.DeliveryDate
end
View 3 Replies
Mar 2, 2011
i faced a problem during i want to create inner join in query builder.
Here is my statement
[Code]....
If i select 2 tables, i can get the result. But when i insert 1 more table, i failed to get my result.
View 4 Replies
Mar 29, 2010
I get this error when I am trying to concatenate the two fields in bold into one field for a datagrid.
select count(cp.iOwnerID) as enrolled,(duration + '' + duration_interval) AS Duration ,session_id,school_id as SchoolId,program_id as ProgramId,convert(nvarchar(10),session_start_date,101) as SessionStartDate, session_class_size as SessionClassSize from dbo.cnSchoolProgramSessions cn with (nolock) left join customerproduct cp on convert(datetime,convert(nvarchar(10),session_start_date,101)) = convert(datetime,convert(nvarchar(10),cp.dtPurchasedate,101)) where record_status = 1 and school_id = '" &
iSchool & "' and program_id = '" & iProgram & "' and (CP.chProductNumber = '" & Me.Label5.Text & "' or CP.chProductNumber IS NULL) group by session_id, school_id, program_id,session_start_date,session_class_size,duration,duration_interval
View 9 Replies
Jun 15, 2010
while i was using sql server authentication, it was running a quite good but suddenly it starts showing an error 'Login Failed for user sa'
Here is my error-Login failed for user 'sa'.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'sa'.
Here is my code-
<add name="MyDB" connectionString="Data Source=ERPTEST;Initial Catalog=LoginDatabase;User ID=sa;Password=sa"
providerName="System.Data.SqlClient" />
View 2 Replies
May 7, 2010
I sucessfully installed SQL Server Express 2010 on my windows server. I then tried to install the SQL Server 2008 management studio via Web Platform Installer but it failed (it did however sucessfully install powershell).
[Code]....
View 1 Replies