Showing posts with label urgent. Show all posts
Showing posts with label urgent. Show all posts

Saturday, March 24, 2012

Please help ! Server Error in Application ! Object variable or

Hi,

One urgent issue in ASP.Net.

We have hosted an asp.net application in a windows 2003 server machine. The
application runs well but ONCE IN A WHILE it comes up with the error, "Server
Error in '/CreditApplication' Application."
The error details are given below.

Sometimes, when we call the URL, it takes a long to load and finally doesnt
load and comes up with this error.

I dont understand why it works some time and doesnt work at other times.

The line in which the error is shown is a function, the contents of which
are given below.

*------------

Private Sub LocContracts()
Dim OnlineConnection As New OnlineConnection
Dim Sql, SqlComm, SqlDR

Dim Branch = "ABHN"

Dim DBConnection = OnlineConnection.OnlineDBConnection
(Database)
Dim Trans As SqlClient.SqlTransaction =
DBConnection.BeginTransaction(IsolationLevel.ReadC ommitted)
Sql = "Update Applications Set ContractType = 5,Repayment =
Case "
Sql = Sql & " when (LoanAmount * 3 / 100) > 40 Then
(LoanAmount * 3 /100)"
Sql = Sql & " else 40 End "
Sql = Sql & " where BranchId in ( Select BranchId from Branch
where BranchName = '" & Branch & "')"
Sql = Sql & " And ContractType = 0"

SqlComm = New SqlCommand(Sql, DBConnection)
SqlComm.Transaction = Trans
SqlDR = SqlComm.ExecuteReader()
Trans.Commit()

SqlDR.Close()
SqlComm = Nothing
Sql = Nothing
OnlineConnection = Nothing

End Sub

*------------

I was wondering if it has anything to do with "isolationlevel.readcommitted"

The error message is given below

*------------

Server Error in '/CreditApplication' Application.
________________________________________
Object variable or With block variable not set.
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.NullReferenceException: Object variable or With
block variable not set.

Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object variable or With block variable not set.]

Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
+934

Extraction.ViewApplication.LocContracts() in
D:\CreditApplication-1.0H\ViewApplication\ViewApplicationExtraction.asp x.vb:396

Extraction.ViewApplication.Page_Load(Object sender, EventArgs e) in
D:\CreditApplication-1.0H\ViewApplication\ViewApplicationExtraction.asp x.vb:54

System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
________________________________________
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300

*------------

Any help would be really appreciated.
Many ThanksWhich line is 396 in your code? It's attempting to use a NULL object
somewhere. Possibly the database connection failed in
OnlineDBConnection. If this is production code, you should add some
exception handling and logging for the DB connection and execution
calls.

Also, why use a DataReader to execute an Update statement? An
ExecuteNonQuery() seems more appropriate in this case.

-Carl
Hi Carl,

Thanks very much for your reply.
I have updated my code with ExecuteNonquery().

Line 396 in my code is given below

Dim Trans As SqlClient.SqlTransaction =
DBConnection.BeginTransaction(IsolationLevel.ReadC ommitted)

As given in my post, iam getting this error only once in a while which is
really confusing me.

Regards,
Majo

"carl" wrote:

> Which line is 396 in your code? It's attempting to use a NULL object
> somewhere. Possibly the database connection failed in
> OnlineDBConnection. If this is production code, you should add some
> exception handling and logging for the DB connection and execution
> calls.
> Also, why use a DataReader to execute an Update statement? An
> ExecuteNonQuery() seems more appropriate in this case.
> -Carl
>
> We have hosted an asp.net application in a windows 2003 server machine. The
> application runs well but ONCE IN A WHILE it comes up with the error, "Server
> Error in '/CreditApplication' Application."
> The error details are given below.

Did you ever resolve this issue? I'm currently experiencing something
similar. An ASP.NET application was running fine on a Windows XP
machine. But now that we've moved it to Windows Server 2003, it
*sometimes* gets the error that you described:

System.NullReferenceException: Object variable or With block variable
not set.
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)

This is while accessing a COM object. Once again, it's worked
flawlessly on XP for quite a while now, but seems to occasionally have
problems on Windows Server 2003 (maybe the operating system isn't the
main issue, but I don't know what other differences exist).

- Roger
Hi Roger,

I havent solved my problem yet.

I was wondering if it has something to do with database locks. I checked for
any locks, but couldnt find any at the time of the error.

I have no idea how to solve this problem.

Please let me know if you come across any solutions.

Thanks
majo

"rogercnorris@.yahoo.com" wrote:

> > We have hosted an asp.net application in a windows 2003 server machine. The
> > application runs well but ONCE IN A WHILE it comes up with the error, "Server
> > Error in '/CreditApplication' Application."
> > The error details are given below.
> Did you ever resolve this issue? I'm currently experiencing something
> similar. An ASP.NET application was running fine on a Windows XP
> machine. But now that we've moved it to Windows Server 2003, it
> *sometimes* gets the error that you described:
> System.NullReferenceException: Object variable or With block variable
> not set.
> at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
> o, Type objType, String name, Object[] args, String[] paramnames,
> Boolean[] CopyBack)
> This is while accessing a COM object. Once again, it's worked
> flawlessly on XP for quite a while now, but seems to occasionally have
> problems on Windows Server 2003 (maybe the operating system isn't the
> main issue, but I don't know what other differences exist).
> - Roger
>
Hi,

This time, I got a new Server Error

"Fill: selectcommand.connection property has not been initialized" in
another asp page. This also comes only ONCE IN A WHILE.

The error is coming in the line with "Fill" in the code given below

*------------
DBConnection = OnlineConn.OnlineDBConnection(Database)

Sql = KeyWord

Dim SqlCommand As New SqlCommand(Sql, DBConnection)
Dim SqlAdapter As New SqlDataAdapter(SqlCommand)
Dim DataSet As New DataSet
SqlAdapter.Fill(DataSet)

*------------

While linking this with my previous error " Object variable with block ... "
, I was wondering if this error has anything to do with the database
connection.

Will this happen if the asp.net page is refreshed frequently ?

Thanks in advance for your help

Rgds,
Majo

"majo" wrote:

> Hi Roger,
> I havent solved my problem yet.
> I was wondering if it has something to do with database locks. I checked for
> any locks, but couldnt find any at the time of the error.
> I have no idea how to solve this problem.
> Please let me know if you come across any solutions.
> Thanks
> majo
>
> "rogercnorris@.yahoo.com" wrote:
> > > We have hosted an asp.net application in a windows 2003 server machine. The
> > > application runs well but ONCE IN A WHILE it comes up with the error, "Server
> > > Error in '/CreditApplication' Application."
> > > The error details are given below.
> > Did you ever resolve this issue? I'm currently experiencing something
> > similar. An ASP.NET application was running fine on a Windows XP
> > machine. But now that we've moved it to Windows Server 2003, it
> > *sometimes* gets the error that you described:
> > System.NullReferenceException: Object variable or With block variable
> > not set.
> > at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
> > o, Type objType, String name, Object[] args, String[] paramnames,
> > Boolean[] CopyBack)
> > This is while accessing a COM object. Once again, it's worked
> > flawlessly on XP for quite a while now, but seems to occasionally have
> > problems on Windows Server 2003 (maybe the operating system isn't the
> > main issue, but I don't know what other differences exist).
> > - Roger
Hi,

I created a new virtual directory in IIS and xcopied the whole content
(which is giving me the server error)

Right at the moment when i got the server error in my initial application, i
tried the new application which was created by me and it WORKED WELL.

Does this mean, that this server error has nothing to do with database locks
or IIS ?
I think, it has something to do with concurrent connections.
Can anyone help me with the connection parameters which i should use.

Many thanks...

Please help ! Server Error in Application ! Object variable or

Hi,
One urgent issue in ASP.Net.
We have hosted an asp.net application in a windows 2003 server machine. The
application runs well but ONCE IN A WHILE it comes up with the error, "Serve
r
Error in '/CreditApplication' Application."
The error details are given below.
Sometimes, when we call the URL, it takes a long to load and finally doesnt
load and comes up with this error.
I dont understand why it works some time and doesnt work at other times.
The line in which the error is shown is a function, the contents of which
are given below.
*---
Private Sub LocContracts()
Dim OnlineConnection As New OnlineConnection
Dim Sql, SqlComm, SqlDR
Dim Branch = "ABHN"
Dim DBConnection = OnlineConnection.OnlineDBConnection
(Database)
Dim Trans As SqlClient.SqlTransaction =
DBConnection.BeginTransaction(IsolationLevel.ReadCommitted)
Sql = "Update Applications Set ContractType = 5,Repayment =
Case "
Sql = Sql & " when (LoanAmount * 3 / 100) > 40 Then
(LoanAmount * 3 /100)"
Sql = Sql & " else 40 End "
Sql = Sql & " where BranchId in ( Select BranchId from Branch
where BranchName = '" & Branch & "')"
Sql = Sql & " And ContractType = 0"
SqlComm = New SqlCommand(Sql, DBConnection)
SqlComm.Transaction = Trans
SqlDR = SqlComm.ExecuteReader()
Trans.Commit()
SqlDR.Close()
SqlComm = Nothing
Sql = Nothing
OnlineConnection = Nothing
End Sub
*---
I was wondering if it has anything to do with "isolationlevel.readcommitted"
The error message is given below
*---
Server Error in '/CreditApplication' Application.
________________________________________
Object variable or With block variable not set.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information abou
t
the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object variable or With
block variable not set.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object variable or With block variable not set.]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack
)
+934
Extraction.ViewApplication.LocContracts() in
D:\CreditApplication-1. 0H\ViewApplication\ViewApplicationExtrac
tion.aspx.vb:
396
Extraction.ViewApplication.Page_Load(Object sender, EventArgs e) in
D:\CreditApplication-1. 0H\ViewApplication\ViewApplicationExtrac
tion.aspx.vb:
54
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
________________________________________
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
*---
Any help would be really appreciated.
Many ThanksWhich line is 396 in your code? It's attempting to use a NULL object
somewhere. Possibly the database connection failed in
OnlineDBConnection. If this is production code, you should add some
exception handling and logging for the DB connection and execution
calls.
Also, why use a DataReader to execute an Update statement? An
ExecuteNonQuery() seems more appropriate in this case.
-Carl
> We have hosted an asp.net application in a windows 2003 server machine. The
> application runs well but ONCE IN A WHILE it comes up with the error, "Ser
ver
> Error in '/CreditApplication' Application."
> The error details are given below.
Did you ever resolve this issue? I'm currently experiencing something
similar. An ASP.NET application was running fine on a Windows XP
machine. But now that we've moved it to Windows Server 2003, it
*sometimes* gets the error that you described:
System.NullReferenceException: Object variable or With block variable
not set.
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)
This is while accessing a COM object. Once again, it's worked
flawlessly on XP for quite a while now, but seems to occasionally have
problems on Windows Server 2003 (maybe the operating system isn't the
main issue, but I don't know what other differences exist).
- Roger

PLEASE HELP ! URGENT ! repeater errors !

I now get the following error with my repeater...
short desc. of problem. I want to display hyperlinks with a repeater,
but add "link not available" and disable the hyperlink if the field in
DB is null.

as it is now i get:

"Compilation Error"
"Compiler Error Message: BC30201: Expression expected"

in the compiler output i get "error BC30545: Property access must
assign to the property or use its value."

at the line: Container.DataItem("SubjectName") & ": link not
available",
and i also get "error BC30205: End of statement expected" at the same
line...

can anyone see what i'm doing wrong ?

everything was working fine until i tried to add the conditional
statements (iif...)

this is my code in the itemtemplate of the repeater (except the html
tables etc)

<asp:HyperLink NavigateUrl='<%# "http://" &
Container.DataItem("Dep_WebsiteURL") %>'text='<%#
iif(Container.DataItem("Dep_WebsiteURL") is dbnull.value,
Container.DataItem("SubjectName") & ": link not available",
Container.DataItem("SubjectName")) %>'enabled='<%#
iif(Container.DataItem("Dep_WebsiteURL") is dbnull.value, false,
true)%>'Runat="server" Target="_blank" ID="Hyperlink1" /
thanks a lot...I'm kind of in a hurry here...

FredrikFredrik why don't you try doing it in your CodeBehind ?

*** Sent via Developersdex http://www.developersdex.com ***
Howdy everyone !!!
Please disregard this message ! I have solved the problem !
Thanks alot, especially "london calling" who provided me with a better
solution !!

Thanks

Wednesday, March 21, 2012

Please help me how to do this - Urgent

Hi,
I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.
Thanks,
VishnuAssuming you cant merge your values in SQL, you can probably iterate the
dataset / datatable in a loop, pick out the values and glue them together or
you could probably just use a templatecolumn and merge the columns that way
As an iteration example this might get you started:
ArrayList s = new ArrayList();
foreach (DataRow myDataRow in myDataSet.Tables["Customers"].Rows)
{
s.Add(myDataRow["filed_by"].ToString() +
myDataRow["full_name"].ToString());
}
Then bind that to your datagrid as shown here
/url]
Regards
John Timney (MVP)
VISIT MY WEBSITE:
[url]http://www.johntimney.com" target="_blank">http://www.johntimney.com/blog/defa...johntimney.com
http://www.johntimney.com/blog
<settyv@.gmail.com> wrote in message
news:1163098102.821494.319230@.k70g2000cwa.googlegroups.com...
> Hi,
> I need to merge some of the rows in the datagrid in asp.net 1.1 with
> comma separator.For example i have column name Filed_by which list the
> customer's full name.Now i need to merge all the customer name cells
> into single cell seperated by comma. Please let me know how can i do
> that.Also if you have some example that would be great.
>
> Thanks,
> Vishnu
>

Please help me how to do this - Urgent

Hi,

I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.

Thanks,
VishnuAssuming you cant merge your values in SQL, you can probably iterate the
dataset / datatable in a loop, pick out the values and glue them together or
you could probably just use a templatecolumn and merge the columns that way

As an iteration example this might get you started:

ArrayList s = new ArrayList();
foreach (DataRow myDataRow in myDataSet.Tables["Customers"].Rows)
{
s.Add(myDataRow["filed_by"].ToString() +
myDataRow["full_name"].ToString());

}

Then bind that to your datagrid as shown here

http://www.johntimney.com/blog/defa...e3-95c3f29a8a8a
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
<settyv@.gmail.comwrote in message
news:1163098102.821494.319230@.k70g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Hi,
>
I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.
>
>
Thanks,
Vishnu
>

Friday, March 16, 2012

please help me to solve my provblem..its very urgent

i have a button in my webform. whenever i click that button it should display the crystal report designer window so that the end user can design his own report...
i don't know how to display crystal report designer window at runtime in asp.net.please help me...

please please help me...its very very urgent

Hello Niranjana,

A CrystalReportViewer needs a CrystalReportSource in order to function. So, in the scenario you outlined above, you'd need to dynamically add both to the page. In VB.NET, this would look something like the following:

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim crs As New CrystalDecisions.Web.CrystalReportSource crs.ID = "CrystalReportSource1" crs.Report.FileName = "CrystalReport1.rpt" form1.Controls.Add(crs) Dim crv As New CrystalDecisions.Web.CrystalReportViewer crv.Height = New Unit("200px") crv.Width = New Unit("200px") crv.AutoDataBind = True crv.ReportSourceID = "CrystalReportSource1" form1.Controls.Add(crv) End Sub

HTH,
Clay


sir,

thank you so much for ur information.

but my problem is different. I need to design the crystal report at runtime... ie one end user be able to design his crystal report.. ie adding fields ,formatting crystal reports all those things...

if u have any idea please help me sir

thanks & regards

nisha


Hi nish,

I dont whether its possible to enable the users to design his own reports... But try the below logic...

1. You need to list all of the fileds available in the reports...

2. Create the query which fetches the data from the table for the fields selected by the user and empty for unselected fileds. (initially you need to design the reports with all the fields)

3. suppress the fields in crystal reports if the field value is empty.

I hope the above will help you...


that i can do sir,i have already listed all the fields of a table in a listbox and use that to create crystal report...

my problem is really different...the end user should able to design his own crystal reports.

at runtime the designer should come. can we use any Report Designer Component(RDC) in asp.net...i am not getting an exact idea from net also. if u can please help me sir...


Hi nish,

Sorry I dont know whether its possible or not... I think its not available in Crystal reports... but may be in some other third party report tools...


anyway..thank you sir..