Welcome :Guest
Congratulations!!!

Top 5 Contributors of the Month
Abhijit

### WebMatrix conversion failed when converting from a character string to uniqueidentifier?

I am trying to retrieve xml from a small function in my .cshtml page. Its throwing me an error. This however, runs fine in a console/form environment.

It takes 3 parameters and 1 exception.

myDll.GetXML(year, username, uniqueidentifier, out ex);

When I run this page I get the error, "Conversion failed when converting from a character string to uniqueidentifier."

Or a stack of.

System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBeha

### Arabic QueryString with Url Rewrite Solution

Alsalamo 3alaykom ,

as we know that if you use Intelligencia.UrlRewriter.RewriterHttpModule or IIS URL Rewriting , we will face problems with arabic urls

as this

http://localhost:1234/Pages/???? ?????? ?????? ??????????

and the Rule is :

<rewrite url="~/Pages/(.+)" to="~/ShowPages.aspx?Page=$1" /> you will recive the QueryString["Page"] Like this Ãâ¢Ã¢â¬Â ÃËÃÂ§ÃËÃÂ¦ÃËÃÂ¨ ÃËÃÂ§Ãâ¢Ã¢â¬Å¾ÃËÃÂ¹Ãâ¢Ã¢â¬Â¦Ãâ¢Ã Â ÃËÃÂ¯ Ãâ¢Ã¢â¬Å¾Ãâ¢Ã¢â¬Å¾ÃËÃÂ´ÃËÃÂ¤Ãâ¢Ãâ Ãâ¢Ã¢â¬Â ÃËÃÂ§Ãâ¢Ã¢â¬Å¾ÃËÃÂ£Ãâ¢ÃâÃËÃÂ§ÃËÃÂ¯Ãâ¢Ã Â Ãâ¢Ã¢â¬Â¦Ãâ¢Ã Â ÃËÃÂ© so it's a big problem , and there is a solution that is : remove the Rule of that rewriting ,, <rewrite url="~/Pages/(.+)" to="~/ShowPages.aspx?Page=$1" />

then open your Global.asax file and Application_BeginRequest method exactly

use the following code to handle you request

void Application_BeginRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Request.Url.ToString().Contains("/Pages/"))
{
String[] txt= Regex.Split(HttpContext.Current.Request.Url.ToString(), @"/");
String page = txt[txt.Length-1];
HttpContext.Current.RewritePath("~/Sh

### Converting ReportDocument object into byte array ?

Hi All,

Is it possible to convert the Report Document object as a byte array and store it in SQL , later retrieve and assing it to a report ?

### Problems converting VS 2003 project to VS 2008

Hi!

I'm having problems converting a VS 2003 project to VS 2008 (tried 2005 as well, same problem). There are several problems;
a) I don't have VS 2003 installed.
b) The project is a web service, however I'm not sure what type of VS project it was created as.
c) The general knowledge about the project setup is..slim.

I get a error message using the conversion wizard, however, I'm not familiar with the tool and I cannot quite find any good information on Google for it, so I am left with a error message I do not understand.

Conversion Issues - myProject.csproj:
Unable to open the Web site 'C:\local\path\to\project\myProject.csproj'. The Web site 'C:\local\path\to\project\myProject.csproj' does not exist.

The web service is not intended to run on the dev machine, it is copied to a test or a prod server. However, I do not know how this was done previously. I'm thinking that in order to convert, it has to access the server on which it should run (which is set somehow in a config maybe). But that doesn't actually make any sence..

If anyone could shed light on this, I would really appreciate it.

Thank you.

### Converting Time formats

Hi guys,

So ive been converting an asp website to asp.net. What i did was run the migration wizard in the old VS2003, then when importing it bk into vs2008, i belive it upgraded it agin. I have been plodding along correcting basic erros and have come stuck with this one. Originallany the site has two input types, one for date and one for time. the new script is below with error im getting. I manged to get the date correct but the time is more tricky. Any suggestions would be appreciated.

Date = FormatdateTime(IIF(IsDBNull(MyRs1.Fields.Item("").Value), Nothing, MyRs1.Fields.Item("").Value), DateFormat.ShortDate)

Time = FormatdateTime(IIF(IsDBNull(MyRs1.Fields.Item("").Value), Nothing, MyRs1.Fields.Item("").Value), DateFormat.ShortTime)

Exception Details: System.InvalidCastException: Conversion from type 'Double' to type 'Date' is not valid.

Source Error:

Line 74: Line 75: 'TODO Need to correct the format Line 76: Time= FormatDateTime(IIf(IsDBNull(MyRs1.Fields.Item("").Value), Nothing, MyR Help converting vbscript to vb.net   Can anyone help me convert the below vbscript to vb.net:   On Error Resume Next Dim sRunTime,sSitupCount,sPushupCount,sRunMin,sRunSec,sRunScore,sCompScore,sBodyCompDim iCompositeScore Set oRE = New RegExp sRunTime = InputBox("Enter your run time")oRE.Pattern = "[0-5][0-9]:[0-5][0-9]" If oRE.Test(sRunTime) = True Then WScript.Echo "Pattern Match"Else MsgBox "You must enter a valid run time in the following format: ""mm:ss""." & vbCr & "Please run the application again." WScript.Quit(Err.Number)End If sRunMin = Left(sRunTime,InStr(sRunTime,":")-1)sRunSec = Right(sRunTime,InStr(sRunTime,":")-1) sBodyComp = InputBox("Enter your waiste measurement")oRE.Pattern = "[2-6][0-9].[0,5]" If Len(sBodyComp) = 2 Then sBodyComp = sBodyComp + ".0"End If If oRE.Test(sBodyComp) = True Then WScript.Echo "Pattern Match"Else MsgBox "You must enter a waiste measurement in the following format: ""nn.n""." & vbCr & "Please run the application again." WScript.Quit(Err.Number)End If sSitupCount = InputBox Converting from PHP to ASP   Dear all friends  Hi to you all. I am now looking for not only your help but als your advices and suggestions to my situation.here is the url of my current running PHP server http://www.yarnxchange.com/index.phpFIrst things I wish to know is which asp controls can replace the current PHP ones to act the same way1.  In the top of the page the Latest news (News Ticker).2. Under the banner logo the black line has a streamer that read data from database and view them in sme way like marquee and when roll over it stops and when click i can go to the details page.3. In the bottom page The Yarn offers section . it shows data from mutiple tables but in the same place when click each item it displays the rows of its table in the right section . I think that there is a way or a data controller that can act the same way I wish your advice.For sure after that I wish to know your ideas , recommendations and advices to make the full conversion in the best way C# to VB: Converting to Boolean   I am converting some C# code to VB, the following code is part of a functionif (bool.Parse(v["Parent"].ToString())) { e.Row.CssClass = "Parent"; } V is System.Data.DataRowView When I convert this to. If Boolean.Parse(v("Parent").ToString()) Then e.Row.CssClass = "Parent" End If The code throws an error "String was not recognized as a valid Boolean" But if I use this code If CBool(v("Parent").ToString) = True Then e.Row.CssClass = "Parent" End If It works fine, which is great, I am just curious why? Software Driving Software: Active Accessibility-Compliant Apps Give Programmers New Tools to Manipul   Active Accessibility was developed to allow people with disabilities to work on PCs-it's used in magnifiers, screen readers, and tactile mice. It can also be used to create applications that drive other software, and its ability to emulate user input is particularly well suited to the design of testing software. Starting from the basics of Active Accessibility, this article leads you through the development of a software testing application. You'll see how this testing application interacts with common controls and other UI elements, then processes the resulting WinEvents.Dmitri KlementievMSDN Magazine April 2000 Converting Crystal Report 2005 to 2008 - Please Tell Me I'm Stupid :)   Hello peeps,   I have a series of Crystal Reports that I can view/edit using Visual Studio 2005 with no issues.  The method I'm using is to simply click on the *.rpt file and it opens in the VS crystal editor with no issues.  The problem I'm having is that we are upgrading to Visual Studio 2008, and when I open the *.rpt file in 2008 it opens as a binary file.  I guess I'm used to everything else in Visual Studio prompting me to convert the older version to the newer version, so I'm not sure what to do in this case.   Is this normal?  Is there an easy conversion method that I'm simply overlooking?  Am I screwed?  Who invented liquid soap, and why? Answers to any of these questions would be greatly appreciated... Error converting data type varchar to numeric.   I create a form to record data using ASP.NET and SQL database... when i run the project show error "Error converting data type varchar to numeric" what's the problem actually.i try to change in datatype in database.. but still showing error...Thanks problem when converting html to pdf using ItextSharp    hi all i have using itextsharp to convert html to pdf and its worked very good in english letters (A-Z) but when i trying to do it with arabic letters i have got empty pdf , can any one help me? what i should do ? Creating a 508 compliant tri fold   I am creating a tri fold and it is 508 compliant but I want the reader to start reading in the middle of the page instead of the beginning. I created the document in Word.  Thanks Converting UTC to another Time... in XSLT SharePoint designer using ddwrt   I am not a programmer, nor do I know any coding languages.  I have a slightly above average understanding of how writing code works, so please keep that in mind when responding....  I am using a list in SharePoint; when the list is updated, I want to display "UPDATED w/ Date and Time".  I cannot figure out how to display the Local Afghanistan time vice UTC or Zulu time. I am trying to figure out what to add in to change the time displayed +4:30 hours.  I am currently using the following code in XSLT with SharePoint Designer: <xsl:if test="ddwrt:FormatDate(string(@Modified), number(1033), 1)=ddwrt:FormatDate(ddwrt:TodayIso(), number(1033), 1)">    <xsl:if test="ddwrt:FormatDate(string(@Modified), number(1033), 1)!=ddwrt:FormatDate(string(@Created), number(1033), 1)">    <Span style="background-color:maroon;color:white">UPDATED <xsl:value-of disable-output-escaping="no" select="@Modified" /></span>    </xsl:if> (/xsl:if> question regarding request.querystring   I have a url like this: http://www.somepage.com/main.aspx.  In this page, when I click on a link it takes me to a page http://www.somepage.com/cental.aspx?cid=200.  So in the cental.aspx.cs page I did the following in the page load:   if(request.querystring["comp"].tostring() != null) { //do some thing } So I got an error like: object reference not set to an instance of reference.   My problem is, I am using the same page.  So when I go from some page, I will have "comp".  but other times not.  So when there is no "comp", how do I handle it in request.querystring?   Request.Querystring and UrlDecoding   (asp.net 2.0, c#)Hi,I have a page requesting a qyerystring looking like this ?test=b%E4st, %E4 is the url-encoded letter ÃÂ¤. I can't change how this looks and encodes since I have no access to the page doing the request.Problem:string strTest = Request.Querystring["test"].ToString();If I then, for instance, just Response.Write(strTest) the character ÃÂ¤ (%E4) is broken. Displayed as a question mark. I have in my web.config the requestEncoding and responseEncoding set to utf-8. That is the way I need to have it, and I can't change that.I've looked around for a solutions for this and the issue seems to be iso-8859-1 vs utf-8 in the querystring and url-decoding. It seems the Request.Querystring automatically url-decodes the string using the default encoding, in my case utf-8. I need it to url-decode using iso-8859-1 instead. I can achieve this by altering the web.config, but as I said earlier this is not an option.I have tried to do this:Encoding enc = Encoding.GetEncoding(28591);string strTest= Request.QueryString["test"];strTest= HttpUtility.UrlDecode(strTest, enc);Not working, since the Request.QueryString already has url-decoded the value using utf-8.Can I somehow override the requestEncoding in the web.config? Or is the any other way of doing this? Is there any way to set a default value to queryString on pageload?   I'm using Response.Redirect for empty QueryString. string var1 = "1"; string var2 = "default.aspx?Page=" + var1; Response.Redirect(var2);I'm not sure if this is the best way to do this. Thanks in advance for any help:)
 Categories:
 ASP.Net Windows Application .NET Framework C# VB.Net ADO.Net Sql Server SharePoint Silverlight Others All