Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Friday, March 30, 2012

Internal connection fatal error.

Hi all,

I don’t know what happened to this function which was working OK for a few month and today it doesn’t work.

In debug mode I kip getting “InvalidOperationaException was unhandled by user code”

On this line:

dtrResults = cmdSelect.ExecuteReader()

Same behaviour on developping PC

I cant find anithing that would create that problem.

 Function GetUserInfo(ByVal myUsr As String, ByVal strRequest As String) As String Dim strConString As String Dim conUsers As SqlConnection Dim cmdSelect As SqlCommand strConString = ConfigurationSettings.AppSettings("conString2") conUsers = New SqlConnection(strConString) Dim dtrResults As SqlDataReader Dim intField As Integer Dim usr As String usr = "select " & strRequest & " user_ID from userlist where ul_user='" usr &= myUsr & "'" conUsers.Open() cmdSelect = New SqlCommand(usr, conUsers) dtrResults = cmdSelect.ExecuteReader() While dtrResults.Read() For intField = 0 To dtrResults.FieldCount - 1 GetUserInfo = dtrResults(intField).ToString() Next End While conUsers.Close() dtrResults.Close() Return GetUserInfo End Function

Any Help will highly appriciated.

Alex.

(1) I recommend using parameterized queries. I doubt if your SQL is building properly. What does your strRequest typically have?

(2) Also some exception handling might help.

Monday, March 12, 2012

Interactive Debugging of Stored Procedure

In VS 2005 with SQL Server Express: How do I debug a stored procedure that is called from a object datasource control while the asp.net code is running?

Thanks

You may need to PRINT debugging information in the stored procedure, or use SQL Profiler to capture a trace when executing the stored procedure.

Friday, March 9, 2012

Integrity checks keeps failing

Hi All,
I am driving myself crazy trying to debug this one. My Integrity check
keeps failing due to:
Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
And
Test (emptySlotCnt == 0) failed. Values are 1 and 0.
I have been researching this all morning. I ran a simple select on the
offending table and it turned out there where 2 columns that had a date that
went beyond the year 9999. I have nulled out the offending columns since
these dates are meaningless in the table. I can now run a select on this
table and return all rows, but the integrity check still fails for the same
reasons.
Can anyone please tell me how to fix this error? restoring the DB is out of
the question since i dont have a clean one without this issue. I am new to
this company and this job has been failing for long before I got here.
TIA,
Joe
jaylou
It is unclear, please provide DDL+ sample data+ keys to test the problem
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
> Hi All,
> I am driving myself crazy trying to debug this one. My Integrity check
> keeps failing due to:
> Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
> And
> Test (emptySlotCnt == 0) failed. Values are 1 and 0.
> I have been researching this all morning. I ran a simple select on the
> offending table and it turned out there where 2 columns that had a date
> that
> went beyond the year 9999. I have nulled out the offending columns since
> these dates are meaningless in the table. I can now run a select on this
> table and return all rows, but the integrity check still fails for the
> same
> reasons.
> Can anyone please tell me how to fix this error? restoring the DB is out
> of
> the question since i dont have a clean one without this issue. I am new
> to
> this company and this job has been failing for long before I got here.
> TIA,
> Joe
>
|||Can you tell me how to send you that info?
"Uri Dimant" wrote:

> jaylou
> It is unclear, please provide DDL+ sample data+ keys to test the problem
>
>
>
>
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
>
>
|||Post it here
CREATE TABEL tbl....
INSERT INTO tbl VALUES (.....
Desired result :
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:547DA248-751B-48FB-A5FC-B14D399554BC@.microsoft.com...[vbcol=seagreen]
> Can you tell me how to send you that info?
> "Uri Dimant" wrote:

Integrity checks keeps failing

Hi All,
I am driving myself crazy trying to debug this one. My Integrity check
keeps failing due to:
Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
And
Test (emptySlotCnt == 0) failed. Values are 1 and 0.
I have been researching this all morning. I ran a simple select on the
offending table and it turned out there where 2 columns that had a date that
went beyond the year 9999. I have nulled out the offending columns since
these dates are meaningless in the table. I can now run a select on this
table and return all rows, but the integrity check still fails for the same
reasons.
Can anyone please tell me how to fix this error? restoring the DB is out of
the question since i dont have a clean one without this issue. I am new to
this company and this job has been failing for long before I got here.
TIA,
Joejaylou
It is unclear, please provide DDL+ sample data+ keys to test the problem
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
> Hi All,
> I am driving myself crazy trying to debug this one. My Integrity check
> keeps failing due to:
> Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
> And
> Test (emptySlotCnt == 0) failed. Values are 1 and 0.
> I have been researching this all morning. I ran a simple select on the
> offending table and it turned out there where 2 columns that had a date
> that
> went beyond the year 9999. I have nulled out the offending columns since
> these dates are meaningless in the table. I can now run a select on this
> table and return all rows, but the integrity check still fails for the
> same
> reasons.
> Can anyone please tell me how to fix this error? restoring the DB is out
> of
> the question since i dont have a clean one without this issue. I am new
> to
> this company and this job has been failing for long before I got here.
> TIA,
> Joe
>|||Can you tell me how to send you that info?
"Uri Dimant" wrote:

> jaylou
> It is unclear, please provide DDL+ sample data+ keys to test the problem
>
>
>
>
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
>
>|||Post it here
CREATE TABEL tbl....
INSERT INTO tbl VALUES (.....
Desired result :
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:547DA248-751B-48FB-A5FC-B14D399554BC@.microsoft.com...[vbcol=seagreen]
> Can you tell me how to send you that info?
> "Uri Dimant" wrote:
>

Integrity checks keeps failing

Hi All,
I am driving myself crazy trying to debug this one. My Integrity check
keeps failing due to:
Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
And
Test (emptySlotCnt == 0) failed. Values are 1 and 0.
I have been researching this all morning. I ran a simple select on the
offending table and it turned out there where 2 columns that had a date that
went beyond the year 9999. I have nulled out the offending columns since
these dates are meaningless in the table. I can now run a select on this
table and return all rows, but the integrity check still fails for the same
reasons.
Can anyone please tell me how to fix this error? restoring the DB is out of
the question since i dont have a clean one without this issue. I am new to
this company and this job has been failing for long before I got here.
TIA,
Joejaylou
It is unclear, please provide DDL+ sample data+ keys to test the problem
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
> Hi All,
> I am driving myself crazy trying to debug this one. My Integrity check
> keeps failing due to:
> Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
> And
> Test (emptySlotCnt == 0) failed. Values are 1 and 0.
> I have been researching this all morning. I ran a simple select on the
> offending table and it turned out there where 2 columns that had a date
> that
> went beyond the year 9999. I have nulled out the offending columns since
> these dates are meaningless in the table. I can now run a select on this
> table and return all rows, but the integrity check still fails for the
> same
> reasons.
> Can anyone please tell me how to fix this error? restoring the DB is out
> of
> the question since i dont have a clean one without this issue. I am new
> to
> this company and this job has been failing for long before I got here.
> TIA,
> Joe
>|||Can you tell me how to send you that info?
"Uri Dimant" wrote:
> jaylou
> It is unclear, please provide DDL+ sample data+ keys to test the problem
>
>
>
>
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
> > Hi All,
> > I am driving myself crazy trying to debug this one. My Integrity check
> > keeps failing due to:
> > Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
> > And
> > Test (emptySlotCnt == 0) failed. Values are 1 and 0.
> >
> > I have been researching this all morning. I ran a simple select on the
> > offending table and it turned out there where 2 columns that had a date
> > that
> > went beyond the year 9999. I have nulled out the offending columns since
> > these dates are meaningless in the table. I can now run a select on this
> > table and return all rows, but the integrity check still fails for the
> > same
> > reasons.
> >
> > Can anyone please tell me how to fix this error? restoring the DB is out
> > of
> > the question since i dont have a clean one without this issue. I am new
> > to
> > this company and this job has been failing for long before I got here.
> >
> > TIA,
> > Joe
> >
>
>|||Post it here
CREATE TABEL tbl....
INSERT INTO tbl VALUES (.....
Desired result :
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:547DA248-751B-48FB-A5FC-B14D399554BC@.microsoft.com...
> Can you tell me how to send you that info?
> "Uri Dimant" wrote:
>> jaylou
>> It is unclear, please provide DDL+ sample data+ keys to test the problem
>>
>>
>>
>>
>> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
>> news:F5825753-E60C-4062-9361-859BBFA5E9C0@.microsoft.com...
>> > Hi All,
>> > I am driving myself crazy trying to debug this one. My Integrity check
>> > keeps failing due to:
>> > Test (m_freeCnt == freeCnt) failed. Values are 7798 and 8094.
>> > And
>> > Test (emptySlotCnt == 0) failed. Values are 1 and 0.
>> >
>> > I have been researching this all morning. I ran a simple select on the
>> > offending table and it turned out there where 2 columns that had a date
>> > that
>> > went beyond the year 9999. I have nulled out the offending columns
>> > since
>> > these dates are meaningless in the table. I can now run a select on
>> > this
>> > table and return all rows, but the integrity check still fails for the
>> > same
>> > reasons.
>> >
>> > Can anyone please tell me how to fix this error? restoring the DB is
>> > out
>> > of
>> > the question since i dont have a clean one without this issue. I am
>> > new
>> > to
>> > this company and this job has been failing for long before I got here.
>> >
>> > TIA,
>> > Joe
>> >
>>