Click here to Skip to main content
16,005,181 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: i want to know the number hits customers are visting Pin
Christian Graus14-Apr-08 19:53
protectorChristian Graus14-Apr-08 19:53 
GeneralRe: i want to know the number hits customers are visting Pin
Soumini Ramakrishnan14-Apr-08 20:03
Soumini Ramakrishnan14-Apr-08 20:03 
GeneralRe: i want to know the number hits customers are visting Pin
N a v a n e e t h14-Apr-08 20:15
N a v a n e e t h14-Apr-08 20:15 
GeneralRe: i want to know the number hits customers are visting Pin
Christian Graus14-Apr-08 21:12
protectorChristian Graus14-Apr-08 21:12 
GeneralRe: i want to know the number hits customers are visting Pin
N a v a n e e t h14-Apr-08 21:23
N a v a n e e t h14-Apr-08 21:23 
GeneralRe: i want to know the number hits customers are visting Pin
ajaych15-Apr-08 19:50
ajaych15-Apr-08 19:50 
GeneralRe: i want to know the number hits customers are visting Pin
Christian Graus16-Apr-08 11:18
protectorChristian Graus16-Apr-08 11:18 
GeneralRe: i want to know the number hits customers are visting Pin
N a v a n e e t h14-Apr-08 20:19
N a v a n e e t h14-Apr-08 20:19 
Generalconverssion of PDF pages into images Pin
Arihant rathi14-Apr-08 18:54
Arihant rathi14-Apr-08 18:54 
GeneralRe: converssion of PDF pages into images Pin
Christian Graus14-Apr-08 19:18
protectorChristian Graus14-Apr-08 19:18 
QuestionGlobalization and Date Format Pin
andrew_dk14-Apr-08 12:29
andrew_dk14-Apr-08 12:29 
GeneralDash boards Pin
kjosh14-Apr-08 12:01
kjosh14-Apr-08 12:01 
GeneralRe: Dash boards Pin
Christian Graus14-Apr-08 12:30
protectorChristian Graus14-Apr-08 12:30 
GeneralRe: Dash boards Pin
Hamid_RT14-Apr-08 21:51
Hamid_RT14-Apr-08 21:51 
QuestionCustom Control Problem Pin
DominionZA14-Apr-08 11:14
DominionZA14-Apr-08 11:14 
GeneralRe: Custom Control Problem Pin
Christian Graus14-Apr-08 11:20
protectorChristian Graus14-Apr-08 11:20 
GeneralRe: Custom Control Problem Pin
DominionZA14-Apr-08 11:24
DominionZA14-Apr-08 11:24 
GeneralSimple but confusing ASP .NET /javascript question Pin
Mohammad A Gdeisat14-Apr-08 11:05
Mohammad A Gdeisat14-Apr-08 11:05 
GeneralRe: Simple but confusing ASP .NET /javascript question Pin
Christian Graus14-Apr-08 11:19
protectorChristian Graus14-Apr-08 11:19 
GeneralRe: Simple but confusing ASP .NET /javascript question Pin
Mohammad A Gdeisat14-Apr-08 11:38
Mohammad A Gdeisat14-Apr-08 11:38 
QuestionHow To Store a File in Database Using FileUpLoad web control Pin
ArunVijay14-Apr-08 7:49
ArunVijay14-Apr-08 7:49 
AnswerRe: How To Store a File in Database Using FileUpLoad web control Pin
Mark J. Miller14-Apr-08 8:37
Mark J. Miller14-Apr-08 8:37 
QuestionDataReader throws exception Pin
jamie21cor14-Apr-08 3:35
jamie21cor14-Apr-08 3:35 
Hi, I was wondering if anyone could help me with a DataTable problem. I am working in ASP.NET C#, The code that I have written is listed below. The moSqlDataReader can be viewed when in debug mode and the record that is asked for is seen, but when the reader is called into the DataTable using the .Load() function the DataReader shows a thrown exception of System.InvalidOperationException in the Depth and FieldCount properties when viewed in Debug mode

Code:
<br />
<small>msUserName = Request.QueryString.Get("username");<br />
            <br />
LabelUserName.Text = msUserName;<br />
UserName.Value = msUserName;<br />
moMembershipUser = Membership.GetUser(msUserName);<br />
<br />
msEmailAddress = moMembershipUser.Email;<br />
            <br />
moSqlConnection = new SqlConnection();<br />
moSqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["AppSqlServer"].ConnectionString;<br />
<br />
moSqlCommand = new SqlCommand();<br />
moSqlCommand.CommandText = "SELECT * From tblUserInfo WHERE UserID = @UserID ";<br />
moSqlCommand.CommandType = CommandType.Text;<br />
moSqlCommand.Connection = moSqlConnection;<br />
            <br />
// UserID Parameter<br />
moSqlParameterUser = new SqlParameter();<br />
moSqlParameterUser.ParameterName = "@UserID";<br />
moSqlParameterUser.SqlDbType = SqlDbType.UniqueIdentifier;<br />
moSqlParameterUser.Direction = ParameterDirection.Input;<br />
moSqlParameterUser.Value = new Guid(moMembershipUser.ProviderUserKey.ToString());<br />
            <br />
moSqlCommand.Parameters.Add(moSqlParameterUser);<br />
moSqlCommand.Connection.Open();<br />
<br />
moSqlDataReader = moSqlCommand.ExecuteReader(CommandBehavior.CloseConnection);<br />
<br />
moDataTable = new DataTable();<br />
moDataTable.Load(moSqlDataReader);<br />
<br />
if (moDataTable.Rows.Count == 0){<br />
      msFirstName = "";<br />
      msLastName = "";<br />
}else{<br />
      moDataTable.PrimaryKey = new DataColumn[] { moDataTable.Columns["UserID"] };<br />
      msFirstName = moDataTable.Rows.Find("FirstName");<br />
      msLastName = moDataTable.Rows.Find("LastName");<br />
}<br />
<br />
FirstName.Text = msFirstName;<br />
LastName.Text = msLastName;<br />
EmailAddress.Text = msEmailAddress;<br />
            <br />
moDataTable.Dispose();<br />
moSqlCommand.Dispose();<br />
moSqlConnection.Dispose();</small>


I dont understand why the application is returning this, I have checked the internet and several books but have found no reason for this error. I would appreciate if anyone could help fix this.

Thanks

modified on Monday, April 14, 2008 9:44 AM

GeneralRe: DataReader throws exception Pin
Herman<T>.Instance14-Apr-08 4:04
Herman<T>.Instance14-Apr-08 4:04 
GeneralRe: DataReader throws exception Pin
jamie21cor14-Apr-08 4:20
jamie21cor14-Apr-08 4:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.