.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL convert problem / question

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :Sql Server

Hi all

Can somebody explain the following behavior:
The first and second query are quite clear but I
do not understand why the third query does not work ??

Thanks a lot for your comments !

Best regards
Frank Uray

-- Working
FROM [dbo].[GeoDataTest]

View Complete Post

More Related Resource Links

Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

A layout, mouse selection, ListView problem/question

I'm having a problem with a particular layout scenario, and how it interacts with a left mouse click in certain situations. I have 3 rows in a Grid.  The first is a ListView (Master), with the Row Height set to '*'. It's ItemSource is bound to a collection in a ViewModel, and its SelectedItem is bound to a value in the ViewModel.  When the SelectedItem is null, it should take up its entire container (the other 2 rows are invisible). The second row is the GridSplitter.  It's visibility is bound to a value in the ViewModel.  It's only visible when the SelectedItem in the Master ListView is not null.  It's GridRow height is set to Auto, and it's height is explicitly set to 5 (via a style). The third row is a sub-ListView that shows Detail data for the Master SelectedItem in the top ListView.  It's GridRow Height is set to zero by default, and if an item is selected in the Master ListView, it should become visible and have a set height (400 to start, via a binding on the Height of the row). The desired effect is that when an item is selected in the Master ListView, the Detail ListView becomes visible and the GridSplitter allows you to resize the top and bottom as needed.  If necessary, the ScrollBars become visible in the Master ListView to show any items that are now obscured by the Detail ListView (via the automatic scrolling featur

Cannot convert from 'int' to 'System.Data.OracleClient.OracleParameter' - Problem with OracleHel

Hi I downloaded the OracleHelper.cs & I use VisualStudio 2008,I'm suppose to pass values to a stored procedure which accepts 2 parametersWhen i pass from codebehind it says,Cannot convert from 'int' to 'System.Data.OracleClient.OracleParameter'Cannot convert from 'string' to 'System.Data.OracleClient.OracleParameter'The best overloaded method match for 'DataWrapper.ExecuteNonQuery(string, System.Data.CommandType, string, params System.Data.OracleClient.OracleParameter[])' has some invalid argumentsI'm posting mycode,Using STORED PROCEDURE,OracleHelper.ExecuteNonQuery (con, CommandType.StoredProcedure, "sample", Int32.Parse(TextBox1.Text),TextBox2.Text); Plz help !______________________________________If possible,  tell me a solution for this error too !http://forums.asp.net/t/1598804.aspx

problem to convert special character in export to csv

I am using FIleStream object to write .csv file from dataTable/Dataset.It is working fine. But when i got special character in my DataTable like $, @, # ect. it will convert these convert in encoded form( which can't be readable i.e.  â,¬ etc). FileStream flStream;astrFileName = HttpContext.Current.Server.MapPath("~/files/FtpFiles/Download/") + astrFileName + ".csv";if (File.Exists(astrFileName)){flStream = new FileStream(astrFileName, FileMode.Truncate, FileAccess.Write);}else{flStream = new FileStream(astrFileName, FileMode.Create, FileAccess.Write);}StreamWriter objSw = new StreamWriter(flStream);DataTable objDt = idtInstance;//Get No Of Column in GridView int NoOfColumn = objDt.Columns.Count;//Create Header for (int i = 0; i < NoOfColumn; i++){objSw.Write(objDt.Columns[i]);//check not last column if (i < NoOfColumn - 1){objSw.Write("||");}}objSw.Write(objSw.NewLine);//Create Data foreach (DataRow dr in objDt.Rows){//if (dr["GCMSCaseNumber"].ToString() == "14222")//{// string desc = dr["Updates"].ToString();//}for (int i = 0; i < NoOfColumn; i++){string sData = dr[i].ToString();sData = sData.Replace("<br>", " ");sData = sData.Replace("<br/>", " ");sData = sData.Replace("\n", " ");sData = sData.Replace("\t", "

Data Type Convert problem?

1/2 is inputed by user, I hope to get the result 0.5, but both Method1 and Method2 get the result 0 How can I do? Thanks! BTW, I can't require user to input 1.0/2.0      Method1:     double my = 1/2;Method2:     double my = Convert.ToDouble(1/2);  

membership provider with custom login form problem / question

Hi all, I am using the .net membership provider, and I can get past the membership.validate user ok and into my secure page.   The problem I have is that when I reach the secured page, I have a login status control which isn't changing from login to logout.   Below is my login code:If Membership.ValidateUser(txtUsername.Text, txtPassword.Text) Then Response.Redirect("/auth/Default.aspx") If chkRememberMe.Checked Then FormsAuthentication.SetAuthCookie(txtUsername.Text, True) Else FormsAuthentication.SetAuthCookie(txtUsername.Text, False) End If Else lblLoginStatus.Text = "Oops! Login not found!" End If    Thanks in advance.

Drill down question/problem


Bear with me, im no SQL expert by any stretch, so I'll try to explain this the best I can.

We're using system center which has built-in reporting. My sql server is running SQL 2008R2 with reporting services installed/enabled.  My problem is that system center creates drilldown reports but when I click on the links to go through the levels it doesn't send the parameters I'm requesting.  Probably doesn't make sense but my scenario is below.

I request a software summary of all my pc's.  I'm presented in ReportViewer with a list of vendors, I click that vendor and it takes me to the list of software associated with that vendor, along with the number of installs associated with those particular programs.  Now what "should" happen (because it worked with sql 2008) was once I clicked on let's say Office 2010, I would then take me to a list of only pc's that have that software installed.  This is where it breaks.  All it does is ask me for a computerId.  If I leave it blank, the message I get is "Please enter a value for the parameter 'ComputerTargetId'.  The parameter cannot be blank."

so to recap

Microsoft->List of programs published by MS->Office 2010 and install count->(broken) list of pc's with 2010 installed. 


 Sorry if this is con

Interesting Problem WPF Visual to Image Convert.


I am converting the Canvas to Image By using

renderBitmap = new RenderTargetBitmap(desiredWidth, desiredHeight, 96d, 96d, PixelFormats.Pbgra32);// PixelFormats.Pbgra32);
                    //RenderOptions.SetEdgeMode(drawingVisual, EdgeMode.Aliased);
                    RenderOptions.SetBitmapScalingMode(drawingVisual, BitmapScalingMode.HighQuality );
                    drawingVisual.SnapsToDevicePixels = true;
                    var dv = new DrawingVisual();
                    using (DrawingContext ctx = dv.RenderOpen())

                        var vb = new VisualBrush(drawingVisual);

Problem with xmlns when I convert object to XML and XML to object back


Hi, I am facing a strange problem.

I have a class object which I am accessing through webservice call.

Now actually that class has a property with type of Array inside that class and that array is the array of same class object. Means in reality, I have detailed tree structure as per how data gets fill up in that class object.

This is how my XML is and my actual code.

string xml_For_Obj = "";

                xml_For_Obj = "<xml version=\"1.0\" encoding=\"utf-16\">  ";
                xml_For_Obj += "    <ComponentObject xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
                xml_For_Obj += "        <BundledComponents xmlns=\"http://MySite.com/ISI/OtherWebService/Components\">";
                xml_For_Obj += "            <ComponentObject>";
                xml_For_Obj += "                <SKU>Test Sku Name</SKU> ";
                xml_For_Obj += "                <SubGroup>Test SubGroup</SubGroup> ";
                xml_For_Obj += "                <Quantity>70</Quantity> ";
                xml_For_Obj += "                    <BundledComponents >";

decimal place problem in convert string to double


Hi guys, i have a strange error creaping into my web app but am unsure as to how to fix it.  When i run this code on my debug workstation it works fine but when i transfer it to my server things seam to go wrong.

dev station (windows 7) + VS2010
regional and language settings all set to uk
server (windows 2008r2)
regional and language settings all set to uk

What seams to be happening is that when converting a string to a double it works correctly on the dev environment but moves the decimal place to the end on the server.

example code(vb)

dim lat as string = "52.983829"
dim long as string = "-0.036500"

dim latint as double = lat
dim longint as double = long

now on the dev server the value of latint is 52.983829 as you might expect but on when published to the server it becomes 52983829.0

the same with longint on the dev staion it is -0.036500 but on the server it becomes -36500.0

i get equally confusing problems if i try to change it to an integer instead.


can anyone help point be in the right direction?

DbObjectName Problem/Question


I have searched for 'DbObjectName' in posts, but none have provided a satisfactory answer.

When I created a typed dataset using the designer wizard, my connection string was pointing at my Development database and the designer created the code referencing 'DbObjectName' as follows:
<DbSource ConnectionRef="CS_CAPAC (Web.config)" DbObjectName="PrimComm_CAPAC_Dev.dbo.CAPAC_Service_Request" DbObjectType="Table"  .....>

i.e. it prefixed/qualified DbObjectname with my development database name... PrimComm_CAPAC_Dev.dbo.CAPAC_Service_Request

This is not the name of my Production database.
So can I edit the xsd file and remove the database qualifier i.e set it to DbObjectname = "dbo.CAPAC_Service_Request". I have seen this as a solution, but am not sure of the effect.

What is the purpose of DbObjectname and shouldn't the designer just reference the name of the table, as opposed to the database its contained in. Or does this cater for differences in the schema between development and production. I would have thought the connection string would provide it with enough information as to where the table exists.





Convert XML to Xslt problem


That is my sample xml.


<gender code="F"/>



It is ok to get age with 

    <xsl:attribute name="Age">

        <xsl:value-of select="age"/>


how can i get the

Cast Convert Question


What is the "best practice" for converting from one custom reference type to another? I typically handle this in home grown "Converter" classes and was just looking for a more patterened approach.

Chris Wigley MCAD\MCPD

picture library convert dataview webpart problem?



I have picture library,I need to customize the same,for that i need to convert picture library to dataview webpart.

There is no option to convert the picture library listview webpart directly to dataview.

what i did i have added the my picture library in webpart zone then after i was trying to convert to dataview webpart.but it giving error like below:

this web part does not have valid XSLT stylesheet;

Error:A name was started with an invalid character, /_layouts/images/

please help me on same

WCF Permissions Question / Problem


I am attempting to write my first WCF Application and am experiencing trouble when trying to pull data from a Visual FoxPro Table.  Before you cringe and quit reading, I know the problem is a permissions one.  I can debug this code on my development PC but when I put it live it simply doesn't work.

I had this same problem implementing ASMX services.  Since the provider for the VFP tables is 32 bit and the server is running on a 64 bit server (Windows 2008 R2 - IIS 7.5) I had to force those services to run 32 bit and all worked fine.  However I've tried this same thing with WCF Service and that doesn't seem to work.

Yes - I'm using impersonation.  And, I can run parts of the service that DO NOT attempt to open 32 bit OLEDB Providers.

I am developing in VS 2010.  Anyone have any ideas?

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend