This page has moved. You will be automatically redirected to its new location in 10 seconds. If you aren't forwarded to the new page, click here.

Search This Blog

Friday, February 27, 2009

Open a PDF file using VB.NET in an UpdatePanel

After hours of trying n searching, i finally got it done by the following way:
Use a trigger for UpdatePanel on the button
Register your client side script in the button click even
Sample Code:

(ASCX)
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<triggers>
<asp:postbacktrigger controlid="btnSubmit" />
</triggers>
<ContentTemplate>
(ASCX.CS)
Dim strscriptMF As String
strscriptMF = "<script language=javascript>window.open('" & pdfPathMF & "')</script>"
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "strScriptMF", strscriptMF)

Reference:

http://forums.asp.net/p/1082431/1605489.aspx#1605489

Wednesday, February 25, 2009

Range variable <variable> hides a variable in an enclosing block or a range variable previously defined in the query expression

http://msdn.microsoft.com/en-us/library/bb763096.aspx

Scaling your Remote Desktop Screen

I wanted to avoid the scroll bars when I connected to a remote PC and modified the window size according to my requirements. Here z how to do that

http://llemarie.wordpress.com/2007/11/01/tip-scaling-your-remote-desktop-session/

Rounding digits in Javascript

Use varnumber.toFixed(2) to round to two decimal digits:

http://www.webmasterworld.com/javascript/3030448.htm

Use single connection string in Project & Class Library in same Solution

I used while using LINQ to SQL classes and wanted to have only one connection string in the project's web.config and no other connection string in app.config of the DAL class library project

http://fuchangmiao.blogspot.com/2008/11/linq-appconfig-vs-webconfig.html

http://ddkonline.blogspot.com/2008/02/set-connection-string-in-linq-dbml-file.html

http://blogs.msdn.com/jongallant/archive/2007/11/25/linq-and-web-application-connection-strings.aspx

http://stackoverflow.com/questions/450598/change-connection-string-from-class-library-in-main-application-at-run-time

http://geekswithblogs.net/vivek/archive/2007/02/24/107209.aspx

Round a Decimal to 2 decimal digits

http://stackoverflow.com/questions/164926/c-how-do-i-round-a-decimal-value-to-2-decimal-places-for-output-on-a-page

Open a file using VB.NET

http://www.code101.com/Code101/DisplayTip.aspx?cid=69

http://www.computing.net/answers/programming/how-to-open-a-file-in-vbnet/13055.html

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/29500ec3-0aa1-41a1-890b-099e9d4f8aaf/

http://forums.asp.net/p/1219837/2957680.aspx

Use DataView to Sort & Filter Records

http://www.java2s.com/Code/CSharp/Database-ADO.net/illustratestheuseofaDataViewobjecttofilterandsortrows.htm

Pass Parameters to SSRS reports programmatically

Pass parameters to SQL Server Reporting Services Report programmatically:

http://stackoverflow.com/questions/368766/how-to-pass-parameters-to-ssrs-report-programmatically

Wednesday, February 18, 2009

LINQ to SQL and aggregate functions

http://linq.vinkas.com/index.php/2009/01/using-linq-to-sql/

http://knol.google.com/k/developer-shed/using-linq-to-sql/9r4tqiuaz279/3#

http://msdn.microsoft.com/en-us/vbasic/bb688088.aspx

Method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' has no supported translation to SQL.

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/72d3dc56-ad25-439e-a7cc-22d6dcf94f0a

http://66.129.67.4/p/1309841/2576463.aspx

I was getting the above error on calling db.TableName.Single(Function(p) p.ColumnName= valueObj)

Turned out that I had to Convert the valueObj to the respective datatype because valueObj was retrieved as a result of a similar linq expression and was declared as

Dim valueObj= db.TableName0.Single(Function(p) p.ColumnName= valueObj0)

Monday, February 9, 2009

Get rid of VbCrLf from your string

http://bytes.com/groups/net-vb/376883-problem-data-split-vbcrlf

This link worked like heaven for me…and resolved my issue I was experiencing for days J