Forms Data Controls :: Strange SqlDataSource Behaviour Updating GridView On Server Vs Development Machine?
Jun 10, 2010
I'm having a strange problem - probably has a simple answer but, I haven't been able to find it or figure out the cause. I'm hoping someone has had this same problem and figured it out.
Basically - my application works great on the development machine. So I copy it over to the server and it works great. Come back the next day and my GridView is only displaying the first record...I then log into the server remotely and open the web page on the server and all records are returned, so the application works fine on the server. I then return to the local machine and now the application is returning all rows in the GridView. So, weird but, what whatever, it works. Go away and come back again the next day and...
1 ) Only 1 record from dataset is displayed in GridView
2 ) Log onto server remotely and view webpage on server --> all records now display
3 ) Try again on local machine, now application works fine...grr. What am I doing wrong here? Using Visual Web Developer 2008 on Windows XP. Querying SQL Server 2000 (I know, I should switch to 2005 and use VWD 2010 - but ouch, really!) when a text box value changes (Vendor_PO_TextBox.TextChanged)
[Code]....
View 1 Replies
Similar Messages:
Jul 18, 2010
I have ListView and in the ItemTemplate I have:
[Code]....
in code behind I'm doing:
[Code]....
View 6 Replies
Jan 12, 2010
Some one can explain me the behaviour i am observing is correct..?
[Code]....
and here is the connection string:
<add name="SecurityDB" connectionString="Data Source=xyz,8000;Initial Catalog=abcd;User ID=abcd;Password=defg" providerName="System.Data.SqlClient"></add>
i expect it to fail at 101 iteration as the default max pool size is 100 and i am not releasing any connection after i open(ie., Not closing or Disposing). But the strange behaviour is i can go up to 230 iterations and then it gives me a timeout error, can not acquire new connection.
When i look in SQL Database for number of connections created it is only 100.
My question is : When connection is not released, how is it able to re-use the previously opened connection.
View 9 Replies
Jan 1, 2010
this is the code
<%
@
Page
Language="VB"
AutoEventWireup="false"
CodeFile="Default.aspx.vb"
Inherits="_Default" %>
[Code]....
View 2 Replies
Dec 20, 2010
I am using the MaskedEditExtender and MaskedEditValidator, but have experienced some strange
behaviour. (See code example below). When entering a date into the textbox this is what I see:
1. The mask
2. Entering the date and time e.g. "19-01-1980 10:11:12"
3. When removing focus from the textbox the result is: "19-01-1980 19:01:19"
The six first digits of the date is copied as the time? If entering a day of the month larger than 23 and any given month, year and time (eg. 25-10-1980 12:12:12) the validation fails as the six first digits are copied to the time resulting in a time 25:10:19 which obviously is not valid.
I have downloaded the AJAX toolkit sample code and experience the exact same behaviour. When running the AJAX Toolkit samples from[URL] works fine!
Additinal info: Culture is danish (DateTime format is dd-MM-yyyy hh:mm:ss). Tried changing my systems culture to en-US but same behaviour.
Code:
[Code]....
View 5 Replies
Nov 13, 2010
I am developing an application using c# and asp. It need to access some places in the local network . There is a text box in the form which accept the path to be accessed from the user and will store it to a string variable named location.The if loop always return false if the application run in windows 7. and it occurs only when I run from the installed application, otherwise it will return true if the path is true. Here is the code:
[code]...
View 5 Replies
Jan 14, 2011
I have SqlDataSource in 2 pages: Page1.aspx and Page2.aspx. I setup all SqlDataSource with EnableCaching is "True" and CacheDuration is "Infinite", same setup for all 2 SqlDataSource as below:
<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"[code]....
When visitor access Page1.aspx, the SqlDataSource in Page1.aspx will access SQL server to retrieve database and cache the database.
Question-1: After accessing Page1.aspx, then the visitor access Page2.aspx. Will visitor access again SQL Server database in Page2.aspx?
Question-2: One cache at one SqlDataSource is for one page and for one user? Or, one cache at one SqlDataSource is for multiple pages and for one user? Or, one cache at one SqlDataSource is for multiple pages and for multiple users?
View 3 Replies
Dec 13, 2010
I am using a stored procedure for a sqldatasource to update a formview. I believe that I am passing the Obligation_Status value correctly to the stored procedure but the oblgation status field is always updated AS NULL in the database. Does anyone know what I am doing wrong?
[Code]....
[Code]....
View 2 Replies
Nov 23, 2010
Microsoft recommends testing older versions of IE with the following virtual machinesThis is all fine and good, except that the virtual machines can't see the Dev Server from Visual Studio. This makes it very difficult to develop or debug since I have to copy or deploy to IIS for every little change I make. I've tried using ARR, but it seems it can only forward to one specific port at a time, whereas i need to have the port typed in the address bar of the virtual machine to match the port that it is connecting to on the host machine. Is this possible?
View 3 Replies
Sep 1, 2010
I've been working on the ASP.NET Development Server recently (on an MVC project and I'm finding that it is inconsistent in how it serves the changes I make to my code. For example, I make a change to the C#/HTML/CSS/JS in the dev environment and run the page, and the change appears on the screen. But if I edit the HTML again and run the page again, the new change doesn't appear. Even ctrl+F5 doesn't do it. I have to stop the web server and run the app again for the changes to update. Has anyone else experienced this? Is there a way to sort this problem out?
If I'm working in IIS and I change something, a ctrl+F5 will always update the page with the changes I've made. I'd like the dev server to be as reliable.
View 2 Replies
Oct 17, 2010
Using VisualWebDeveloper 2010 on the development machine. All nice and fast.Using VisualWebDeveloper 2008 on the server. Server runs on Windows Server 2008 and has IIS 7.
It looks like that when 'table', a datatabe filled up in C# code behind, is getting longer, then the server (whether running the website on IIS or on the local host of VIsualWebDeveloper2008) is really slowing down. Checked it in debug mode and traced it down to
Adapter.Update(table);
Are there any know issues? Could it be that there is incompatibility between different version of SQL server or something like that? The update works, it is just awefully slow, but only on the server.
View 2 Replies
Feb 1, 2010
I have a asp:button in template field of gridview, I set command name for this and in grid I mention on command event. On clicking the page it shows error message is :Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/>
[code]...
View 2 Replies
Feb 8, 2011
I have to use SQLDataSource for inserting, updating and deleting in database through gridview instead of using SqlDataAdapter and SqlCommand object. I have to do it in ADO.NET (means C# code).
View 3 Replies
Mar 15, 2011
I have three controls a textbox, a drop down and a check box on a webform as below;
[Code]....
I have an SqlDataSource defined and configured with SELETC and UPDATE commands as below;
[Code]....
How can I;
1. Query the SqlDataSource for a specific record (ie ApplicantID = some value) and then read the selected data in the three controls on the webform?
2. Update user changes from the three webform controls back to the SqlDataSource?
View 4 Replies
Nov 25, 2010
i designed a gridview to update, delete the records using sqldatasource, (there is no code in my aspx.cs file) but i dont know how to add the new row the gridview. so that if the table is empty then i cant add / update / delete the data.
how to Add new record on gridview using SQLDatasource without any code behind code?
View 6 Replies
Jul 8, 2010
how to transfer my data from devlopment server to production server ,i have already records exist in my database if i go for script then how can i transfor record in script i can transfor only table ,procedure and views.I am using SqlServer 2005.
View 2 Replies
Aug 26, 2010
Is it possible to use a SQLDataSource to populate a gridview but not use the SQLDataSource for Updating?
I wanted to add the update code in the Gridview_RowUpdating event since it is a complex update I need to do.
I get this message when i click the update button
Updating is not supported by data source 'SqlDataSource1' unless UpdateCommand is specified.
View 4 Replies
Sep 7, 2010
I have textbox that searches for first or last name. Result show in gridview. But when add value in text box and push my button Find nothing happen. Here code:
aspx:
........
<asp:GridView runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="MobileNum"[code]....
View 1 Replies
Feb 2, 2011
I want to sorting the gridview. I am using stored procedure currentlyHow can I put the sorting functions?
protected void populateItem()
{
string itemQuery = "usp_GetStockList";
[code]...
View 2 Replies
Jan 13, 2011
I am developing an ASP.NET website. I wanted to shift whole of my work to another PC of mine. I copied the website to the other PC>Open>Create ASP.NET folder>App_Dataand pasted the database.mdf and database.ldf files there. I was getting some exception when I was trying to run the website as it showed the "could not open the connection from con.open()". Is there some other step too that I am missing?
View 3 Replies
Dec 14, 2010
I have a parent gridview which has a child gridview in the itemsTemplate. Both are binded to different SqlDataSources. I can successfully update and delete rows in the child gridview. After updating in the child gridview, some related data in the parent gridview are not updated automatically. So i have placed ParentGridview.Databind() in the rowupdated event of child gridview. But it doesnt look working.
How can i accomplish this?
View 4 Replies
Jan 27, 2010
[Code]....
[Code]....
View 1 Replies
Feb 20, 2011
I have a GridView with 5 fields. Only two of the fields are edittable (the others are READONLY).
I have an UpdateCommand as follows
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NHLPOOL %>"
SelectCommand="SELECT [PlayerID], [Firstname], [lastname], [Goals], [Assists], [Goals]+[Assists] as Points, [AsOfDate] FROM [PlayerStats], [Player] where [PlayerStats].[PlayerID] =[Player].[ID] ORDER BY Points DESC"
UpdateCommand="UPDATE PlayerStats SET Goals =@GOALS, Assists =@ASSISTS, AsofDate=GETDATE() WHERE PLAYERID = @PLAYERID">
</asp:SqlDataSource>
The issue is I want the PLAYERID GV column to be READONLY but I get a runtime error when updating if the PLAYERID is READONLY.
I get the error "
Must declare the scalar variable "@PLAYERID"."
View 1 Replies
Feb 6, 2010
I have a gridview and a SQLDataSource control. In my gridview I have 2 commandfields "Edit" and "Delete"
The "Edit" command field works as expected. Using the "Delete" command field I get the error below.
Server Error in '/DataControls' Application.
The DELETE statement conflicted with the REFERENCE constraint "FK__titleauth__au_id__0CBAE877". The conflict occurred in database "pubs", table "dbo.titleauthor", column 'au_id'. The statement has been terminated.
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: The DELETE statement conflicted with the REFERENCE constraint "FK__titleauth__au_id__0CBAE877". The conflict occurred in database "pubs", table "dbo.titleauthor", column 'au_id'. The statement has been terminated.
Source Error:
[Code]....
Stack Trace:
[Code]....
View 1 Replies
Oct 4, 2010
I have gridview+sqldatasource. In gridview i have button DELETE. But i want on click this button for some rows execute DELETE command other rows UPDATE. I did:
[Code]....
@index - DeleteParametrs in sqldatasource.
But DELETE works and DELETEVIRTUAL doesn't. Then i insert sourceMain.Delete() in rowcommand after sourceMain.DeleteCommand ... But it's doesn't help me.
View 9 Replies