.net - SqlDataReader Is Drops Columns Randomly?

Jan 16, 2011

I have a very strange issue, I'm using System.Data.SqlClient. to get data from a SQL Server though a stored procedure. When I test the Application at the Development and Stagging machines it works fine but when I deploy the application on the Production Server I randomly getting an SqlDataReader IndexOutOfRangeException with different column names!.The error appears in 2 requests in each 1000 request (approximative).

public static List<CountryInfo> GetAllCountries(){
List<CountryInfo> Items = new List<CountryInfo>();
try{
using (rdr = SqlHelper.ExecuteReader(Globals.ConnectionString, "unv_spGetAllCountries"))
[code]...

View 2 Replies


Similar Messages:

IIS7 Session Drops In Seconds?

Mar 18, 2010

For testing I have 1 isolated page - no masters, controls, .... My sessions are lost after about 30 seconds. I've tried setting timeout on the page itself, in web.config, both, and neither. Tried forms authentication with timeout and windows authentication. Recycle the AppPool after changes.

I can response.write from the Session_Start , but I never get any response.writes from the Session_End.

Some things I've tried:

<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;"
cookieless="false"
timeout="20" />
<sessionState mode="InProc" cookieless="false" timeout="20"/>
<sessionState mode="InProc" timeout="20"/>
<sessionState timeout="20"/>

No luck.

My runtime is set to:

<httpRuntime useFullyQualifiedRedirectUrl="true"
maxRequestLength="204800"
requestLengthDiskThreshold="204800"
executionTimeout="600" />

I don't know what this would be relevant, but I can't think of anything else to post!

View 2 Replies

Web Forms :: Importing Excel Drops Trailing Zero?

Feb 11, 2010

[Code]....

I'm attempting to import, using VB.Net, a spreadsheet from some other users than myself. In the spreadsheet with headers, the numbers I'm importing are in the first column of the spreadsheet (Excel 2003 to 2007). I've defined my datacolumn for the column with the numbers as a "string". What's happening is the trailing zero is dropped; so 1.1 and 1.10 both appear as => 1.1.My code is attatched below.I know I'm missing something, I just don't see it!I've tried both; MicroSoft.JET.OleDb.4.0 and MicroSoft.ACE.OLEDB.12.0 but neither seems to make a difference.

View 1 Replies

AJAX :: HTMLEditor Drops White Spaces Upon Paste

Jan 28, 2011

When copying and pasting from a formatted Micorsoft document, the editor drops many spaces.

If I use the "Paste from MS Word (with cleanup)" feature, the document loses its formatting.

If I don't use it, many spaces get lost and the words around them get concatenated. I just downloaded the last release of the toolkit and the problem still persists.

Users are using Firefox and Chrome with the same result.

View 3 Replies

Web Forms :: Nested Dynamic UserControl Drops Value Of Textbox - Not Dropdownlist?

Aug 12, 2010

I have a webUserControl that is nested inside of another dynamically loaded usercontrol. The nested user control (harddrive) can have multiple iterations, see below for hierarchy When a postback occurs the value in the dropdownlist inside of the nested userControl is saved, but the data in the textboxes is lost. any ideas?

Hierarchy:
insert.aspx
[^--loads] asset.ascx
[^--- loads] harddrive.ascx -- there can be multiple instances of this control inside of the asset.ascx user control

ASPX page code (hosts core dynamic user controls)

[Code]....

ASPX Code behind

[Code]....

View 1 Replies

Forms Data Controls :: DropdownList In Which Value Select Drops In To The Textbox?

Nov 20, 2010

When I try to use this code in a Form View, I get an error message:

Compiler Error Message: CS0103: The name avgift_namnTextBox is not in the current context
ROW: 35

Rad 33: if (dropDownlist.SelectedValue == "Other")
Rad 34: {
Rad 35: avgift_namnTextBox.Enabled = true;
Rad 36: avgift_namnTextBox.Text = string.Empty;
Rad 37: avgift_prisTextBox.Enabled = true;

Here is my code:

<%@ Page Title="Lista medlem" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="medlem.aspx.cs" Inherits="medlem" %>
<asp:FormView ID="FormView3" runat="server" DataKeyNames="faktura_id"
DataSourceID="SkapaFaktura" DefaultMode="Insert" Width="687px">
<InsertItemTemplate>

[Code]....

View 3 Replies

Parent Columns And Child Columns Don't Have Type-matching Columns

Aug 3, 2010

i am making relation between two datatables and m getting this error

in this ds.Tables(0).Columns("In_ID") datatype is string
ds.Tables(1).Columns("row_id") datatype is integer

how i do the type casting here to make dataset relation

ds.Relations.Add("Rel_1", ds.Tables(0).Columns("In_ID"), ds.Tables(1).Columns("row_id"), True)

View 3 Replies

"Chat With Live Agent" Popup Window Drops From The Top In C#?

Jul 17, 2010

This one site in particular Total Training Online has a popup window that drops from the top of the screen on the right side. How can I create that in asp.net c# 2008?

View 2 Replies

SessionID Randomly Changes On Postbacks?

Feb 3, 2011

Our solution is built on ASP.NET v1.1 framework. User is presented with login form, so upon providing credentials this information is posted back to the server. Upon postback SessionID changes and our application crashes as some information which is required for processing is stored in the cache and is identified by SessionID string as a part of the name.

This SessionID change happens absolutely randomly and only to some of the clients. Most of the time browser used to view the page and post info is IE8. I cannot reproduce this issue in our test environment, as SessionID is persistent though-out the whole testing process.

I've already checked all solutions, i.e.

Session cache is used on Page_Load to retrieve/store some information, so it's initialized and contains data stored. I've made a Health Monitoring check on Application_End event to capture any possible AppDomain crashes using Reflection and Diagnostics Libraries and retrieving ShutDownMessage from httpruntime object, but that's also not a case. Cookieless attribute of the sessionState in web.config is set to false (using URL to store SessionID is not an option) All MS security and bug fixes are installed on the server. IIS Server settings are similar to the ones we use in Test Environment.

View 2 Replies

IE7 And 8 Hangs Randomly On CSS Images?

May 1, 2010

We have an ASP.NET 3.5 application that has been in production for over a year. Our last release was a couple of months ago. We use CSS for styling and application of background images to divs and such. The server is Windows 2003 with IIS.

Suddenly, this week, we have had reports from some users that the page seems to hang up while loading. The status bar was showing the name of a background image used in the page main area (assigned in CSS). At our office, some of us could recreate the problem, while others could not. IE6 and Firefox do not seem to be affected, only IE7/8. Running Fiddler on an affected machine and trying to see what was happening with the requests seemed to make the problem go away (while running through Fiddler, it returned when not). Hitting Refresh on a hung load often made the page load just fine.

I checked the background image, and even replaced it with an archived copy. No joy. We re-deployed the app from our production source. No Joy. We restarted IIS and eventually rebooted the whole server. There are no unusual entries in the event logs, the app logs or the IIS logs. Finally, I removed the image entirely and re-styled the page not to use a background image. That solved the problem at least for now.

However, we have reports of other images "hanging." The images are PNGs, but I have heard some rumors that sometimes a GIF hangs, but I have no screenshot to confirm.

This just started happening "out of the blue." There have been no releases or updates applied to the server recently. We even checked updates on clients to see if a recent Windows Update might have caused this on the client, but there was nothing updated within the last couple of weeks.

View 4 Replies

Display Image From Database Randomly?

Jun 6, 2010

I want know How I can Display Image from database randomly when the web page refresh in Asp.net by C# code

View 5 Replies

How Export Data From Access To Excel Randomly

Oct 1, 2010

I want to Export data from ms-Access to Excel. I know the way, How to export data in tabular form.

But i need to export data to the random cell of sheet,and print it.

I got Solution Of How the access data can be export to the excel in particular cell.but i also need porting data form excel to access database. Means i want to get the value of particular cell, and save it into access database.

How to read the value of particular Cell, programmatily..

Is there any way to accomplish this task?

View 1 Replies

C# - GetRequestStream Throws Timeout Exception Randomly

Feb 12, 2010

After googling for couple of days, I really cannot solve described issue. Hope here will find a solution

I'm using attached code when calling WCF service on the same server. I get Timeout error randomly in call WebReq.GetRequestStream()

When I'm check netstat I see that connection remains open, so probably is there a problem, but I don't know how to solve it

//request inicialization
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(url);
WebReq.Method = "POST";
WebReq.ContentType = "application/json; charset=utf-8";
WebReq.ContentLength = buffer.Length;
WebReq.Proxy = null;
WebReq.KeepAlive = false; //also tried with true
WebReq.AllowWriteStreamBuffering = false; //also tried with true
//this produces an error
using (Stream PostData = WebReq.GetRequestStream())
{
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();
}
//open and read response
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Stream Answer = WebResp.GetResponseStream();
StreamReader _Answer = new StreamReader(Answer);
WebResp.Close();
//return string
return _Answer.ReadToEnd();

Timeout is thrown mostly after some 10 seconds of idle time, but also after five or so requests in the row. Really cannot find a pattern.

What could be wrong with this code? Is there any other (better) way for calling WCF service?

View 4 Replies

AJAX :: Modalpopup Displaying Behind Panels Randomly?

Oct 7, 2010

I am working on a project at work and have been trying to implement the modalpopup extender. I have it set to display when invalid criteria is entered and the user tries to save the item. The problem that happens is that it will display correctly for about the first 3-5 times, but then after that the entire popup (messagebox/background) displays behind the content behind all the content, which are within panels. I have tried changing the z-index amongst the popup to something really high and keeping the panels' z-index very low, yet it still does not seem to work.

View 1 Replies

C# - How To Change Column Names Randomly In Gridview

Jun 11, 2010

I am struggling to show different views of gridview with database values. Here is my requirement.

Database Table:

I need to show one drop downlist with three values 1,2,3. If user selects 3 i Need to show a grid like below

Age,AnnualSales and Assortment are names which are coming dynamically from database.

High,Medium and Core all are values

Here my question is I need to show same attribute names.

Like If the name changes from "Assortment" to "Location" I need to show it in different page index .

In page index 2 i need to show like below.

View 2 Replies

A Randomly Generated 20 Character's Alpha-numeric Key?

Mar 14, 2011

How can i create A randomly generated 20 character's alpha-numeric key in asp.net i need to save it i database on some link click.

View 3 Replies

ServerControl Randomly Null / System.NullReferenceException?

Apr 8, 2010

I got a master page with a server control in it. Randomly the server control is inaccessible from codebehind. This doesn't happen on a specific action (eg a Button click or so). Currently I have no clue what this could be. I don't think it's output caching since this is not explcitly activated and the error happens far to seldom for that. But I'm going to disable caching in the master page explicitly with next deployment.

The control is defined in markup. The accompaning codebehind is:

PGFMainNavi.HasAccessToFunction = HasAccessToNaviItem;
// HasAccessToNavi is a local function

Exception is:

System.NullReferenceException: Object reference not set to an instance of an object

View 1 Replies

C# - Why Does Ffmpeg Stop Randomly In The Middle Of A Process

Mar 18, 2010

ffmpeg feels like its taking a long time. I then look at my output file and i see it stops between 6 and 8mbs. A fully encoded file is about 14mb. Why does ffmpeg stop? My code locks up on StandardOutput.ReadToEnd();. I had to kill the process (after seeing it not move for more then 10 seconds when i see it update every second previously) then i get the results of stdout and err. stdout is "" stderr is below.

The output msg shows the filesize ended. I also see a drop in my CPU usage when it stops. I copyed the argument from visual studios. CD to the same working directory and ran the cmd (bin/ffmpeg) and pasted the argument. It was able to complete.

NOTE: I must get std out and err to check for failures.

int soundProcess(string infn, string outfn)
{
string aa, aa2;
aa = aa2 = "DEAD";
var app = new Process();

View 1 Replies

SQLDataReader Find Value Of Each Row?

Nov 10, 2010

I used to use datasets instead of sqldatareaders and I used to be able to do something like this

If dataset.tables(0).Rows(0)(1).ToString()) = "N" Then
lbl.Text = dataset.tables(0).Rows(0)(2).ToString())
Else
'Do Nothing
End If

This obviously doesn't work with sqldatareaders.I have code to see if the SQLDatareader has any rows but was wondering if there was a way to get the value of each rowI'm guessing this is possible and i've had a look around but can't seem to find anything

Dim conn As SqlConnection = New SqlConnection("server='h'; user id='w'; password='w'; database='w'; pooling='false'")
conn.Open()
Dim query As New SqlCommand("DECLARE @investor varchar(10), @sql varchar(1000) Select @investor = 69836 select @sql = 'SELECT * FROM OPENQUERY(db,''SELECT * FROM table WHERE investor = ''''' + @investor + ''''''')' EXEC(@sql)", conn)
Dim oDR As SqlDataReader = query.ExecuteReader()
If oDR.HasRows or dataset.tables(0).Rows(0)(1).ToString()) = "N" Then
lbl.Text = dataset.tables(0).Rows(0)(2).ToString())
Else
'Do Nothing
End If

That is the code I have at the moment which obviously doesn't work

View 2 Replies

Using SqlDataReader In Linq?

Sep 7, 2010

In normal way of write the code as follows in DAL.

DataSet ds=db.executedataset();
IEnumerable<datarow>= ds.tables[0].asEnumerable();

For better performance can use datareader in Linq instead of DataSet

View 11 Replies

SqlDataReader To String[]?

Mar 20, 2011

why the following code doesn't work?

internal static string[] GetToolsForRole(string selectedRole) {
string[] tempStr;
ArrayList myAL = new ArrayList();

[code]...

View 2 Replies

Web Forms :: Randomly Generated Filename With FileUpload Control?

Feb 16, 2011

I have a FileUpload control that currently uploads pics to the Photos folder on my server. What I would like to know is how would I give it a randomly generated filename when it gets uploaded? As I don't want duplicates later on down the line. Cheers.(Code below).

[Code]....

Code Behind:

[Code]....

View 3 Replies

Web Forms :: Textboxes Are Getting Disabled Randomly In Aspx Page?

Apr 1, 2010

I have a aspx content page which is associated with a master page. In the code behind of the master page there have code to populate menu control. Besides the menu there is an AJAX Accordion cotrol which is also binding. In the master page there have n number of javascripts written which are being used in master page and also in the content pages.

In the content page n numbers of functionalities are there. Some times I noticed that the textboxes of the content page is getting disabled randomly. Suppose I have perfomed a task in the page and after that I have seen that the textboxes are disabled but later I have performed the same task and it didn't happen, means the problem is arising randomly.

Onething I want to mention here whenever I am mouse clciking on the textboxes when the textboxes are disabled, nothing happens. Neither the any text being selected nor the mouse pointer is showing (textbox doesn't get focus) but after mouse clicking on one of the textbox if I try to type something the letters are coming in the text box without the letter which I first typed and in the meantime all the textboxes are getting enable again.

View 3 Replies

Security :: Forms Authentication Users Expire Randomly?

Mar 11, 2010

I set up forms authentication in my asp.net application, and everything works apparently without problems. However from time to time some of the users trying to log in inform me that suddenly they cannot enter anymore as their user seems to be deactivated. Even if they try the forgot password entry, they get "user not found" response, but if I check the user is still there, and according to asp.net configuration it is even active.The only solution I found until now to reactivate the user is to remove it and create it again, and then it works. But it cannot work like this of course.

View 5 Replies

Web Forms :: Display Records Randomly And Group By Rate With New ID

Dec 17, 2012

I want to display records randomly in gridview from database

 Eg :

             id      city            category   compname     rate

             1      newyork      Books          mediatech  1000
             2      newyork      Books          Info tech     1000
             3      newyork      Books          Sysmach      999
             4      newyork      Books          Wifi texh       0

Now the data are displaying in descending order by rate wise and there are two company booked  in same price which is 1000 . i want to display random which is one day mediatech should be in top and next day info tech should be in top.

so i need group by rate with newid()

I want to display records randomly in gridview from database

 Eg :

             id      city            category   compname     rate

             1      newyork      Books          mediatech  1000
             2      newyork      Books          Info tech     1000
             3      newyork      Books          Sysmach      999
             4      newyork      Books          Wifi texh       0

Now the data are displaying in descending order by rate wise and there are two company booked  in same price which is 1000 . i want to display random which is one day mediatech should be in top and next day info tech should be in top.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved