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

Top 5 Contributors of the Month
Post New Web Links

need proper substring

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :Sql Server

Table 1

col1 varchar(20)





I want to select currency after first 5 digits ,I know we can write select statement like this

select substring(col1,6,20) as currency from table 1

but I want some code which seperate currency directly only .If you know please let e know.Thanks



View Complete Post

More Related Resource Links

Proper setup using Infopath and Custom Workflow using VS 2008



I have been struggling for a couple of days, trying to set up a decent
structure for an Infopath project using a custom workflow using Visual Studio 2008.

I had a solution with two projects:

1) Sharepoint 2007 Workflow

2) Infopath 2007 form w/code-behind.

I included the xsn, in the VS solution, but after a day or two,
something went wrong, and I lost some work. I still do not know what
happened, but I could not get my changes to persist afterthat  Doing research I have read that this
stucture, using Infopath xsn, within VS does not work correctly with Source
Control. I am using VSS.

So I since made a change to the set-up so that the .xsn (form template) is separate from
Visual Studio. However, I need to leave the code-behind in VS, since I need to debug

This is my latest problem. I have been unable to attach to the correct
process, as VS generates cachse files, and who knows what else.

My question is simple. What is the supported method for debugging InfoPath
code/behind, which uses a Sharepiont Workflow?

I just also want to say that one should not have
to spend a few days just trying to setup a working development environment.

This should be trouble-free, but it is far from being so. I

proper pattern for list of reusable controls


Say you have a for loop which renders a bunch of the exact same control.  This is probably done with RenderAction or RenderPartial.

What is a way to ensure that each of these controls in the list gets wrapped in a div with a unique ID?


DropDownList and TemplateInfo not selecting proper value


I am having trouble with DropDownList (and/or DropDownListFor) when using TemplateInfo's HtmlFieldPrefix in a strongly-typed view.  DropDownList properly selects the value from the model when the prefix hos not been site.  Once I set the value of HtmlFieldPrefix, the value from the model is not selected in the drop-down list.

I am using .NET 3.5SP1 and ASP.NET MVC 2 RC2.


public class TestModel
    public string Text { get; set; }
    public string Option { get; set; }

    public IEnumerable<String> Options
            yield return "One";
            yield return "Two";
            yield return "Three";


public class TestController : Controller
    public ActionResult Test()
        return View(new TestModel

Proper upgrade path for out of date portal

I have a MOSS 2007 Portal that is woefully neglected.  A quick glance showed that its version was  The table below list all the current updates. Cumulative Update KB974989 & KB974988 Oct 2009 Cumulative Update KB973410 & KB973409 Oct 2009 Cumulative Update KB971538 & KB972569 Jul 2009 Cumulative Update KB968857, KB968850, &KB968851 Jun 2009 SP2 April 2009 Cumulative Update KB963654 & KB961755 Feb 2009 Cumulative Update KB960010 & KB960011 Dec 2008 Cumulative Update KB956056 & KB956057 Aug 2008 Infrastructure Update KB951695 & KB951297 Jul 2008 SP1 + KB948945 Feb 2008 SP1 + KB941274 Jan 2008 SP1 + KB941422 Jan 2008 SP1 October 2007 public update   Do I have to apply them all in order or can I simply jump straight to the cumulatives in order?  Are there any of other considerations I should be aware of?

Service Operation - Get proper data when browsing the service, but not when calling the service from

Hello, I recently implemented a service operation in an attempt to pass some filter parameters to a data service (a user guid and an organization, actually, for impersonation of a user on the service's call to the application). I successfully added the service operation to the data service, and I can browse the service and see the data filtered as I expected. However, when I call the service operation from the Silverlight client, I don't get any results, even though I should. Am I missing something? Code below if it's helpful. Thanks! Service Operation Definition: [WebGet] public IEnumerable<opportunity> filteredopps(string userid, string org) { /*Define the connection with the impersonated user*/ CrmConnection crmc = CrmConnection.Parse("Authentication Type=Passport; Server=https://" + org + ".crm.dynamics.com/" + org + "; User ID=myuser; Password=mypassword; Device ID=mydeviceid; Device Password=mydevicepassword"); crmc.ImpersonatedUser = new Guid(userid); var crmOnline = new DataContext(crmc); List<opportunity> uplist = new List<opportunity>(); crmOnline.UsingService(service => { var query = from o in crmOnline.opportunityopportunities select o; foreach (opportunity thisopp in query) { uplist.Add(thisopp);

Proper upgrade path for out of date SQL instance

I currently have a SQL backend that is feeding an out of date MOSS 2007 instance.  I have found the following: Version Information   Version 9.00.4053.00 Command: Select @@Version Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86)   May 26 2009 14:24:20   Copyright (c) 1988-2005 Microsoft Corporation  Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2) Version Number KB Article Link Release Date 9.00.4305 SQL Server 2005 SP3 CU10  June 2010 9.00.4294 SQL Server 2005 SP3 CU9 Apr 2010 9.00.4285 SQL Server 2005 SP3 CU8 Feb 2010 9.00.4273 SQL Server 2005 SP3 CU7 Dec 2009 9.00.4266 SQL Server 2005 SP3 CU6 Oct 2009 9.00.4230 SQL Server 2005 SP3 CU5 Aug 2009 9.00.4226 SQL Server 2005 SP3 CU4 June 2009 9.00.4220 SQL Server 2005 SP3 CU3 Apr 2009 9.00.4211 SQL Server 2005 SP3 CU2 Feb 2009 9.00.4207 SQL Server 2005 SP3 CU1 Dec 2008 9.00.4053 SQL Server 2005 SP3 GDR (Security Update) Oct 2009 9.00.4035 SQL Server 2005 SP3 Dec 2008 9.00.3356 SQL Server 2005 SP2 CU17 Dec 2009 Whats the best approach to updating the SQL instance?  Do them in order or can I use the latest cumulative?  Any other issues I should be concerned about?

proper format for number column

Hi  In a column i have number datatype but after filling some no it's giving like that 23,786,23 (mostly like a currency format ) but i need like that 2378623 so give me suggestion how i can implement this in sharepoint 2010 , is there need to bound some column level validation for that ............... 

Prompt "The proper type library could not be found in the system registry" when open SQL2008 Express

Hi folks, I just format my notebook and installed the Win7Pro Eng 32-bit version and then install the SQL2008Express. I restarted my notebook as usual after the installation and open the SQL SMS, it prompt the following error "The proper type library could not be found in the system registry", It's a big dialog with certain text saying I do not have permission...etc. Since, I am using administrator account to open the program already but still fail. I have to repaire the SQL SMS too. May I know any other I can check? Any comment is highly appreciated. Thank you very much! Regards, Tony  

T-SQL 2005 datetime as Mmm-YYYY and proper Order By?

Hi I have datetime column in SQL 2005 table. I want to convert that date time into Mmm-YYYY format i.e. Jan-2010, May-2010, Dec-2010 and then proper ORDER BY in month ordering ( in my actual query I want data to be GROUP BY month & year) Table has OrderDate colmin with type datetime Query result output I am looking is : OrderDate       OrderDateMonthYYYY   ORDER BY too 2010-01-25     Jan-2010 2010-02-15     Feb-2010 2010-08-15     Aug-2010 Any T-SQL 2005 Pls…  

Proper way to do page navigation.

I'm creating a WPF desktop application. I have a MainWindow. Inside the MainWindow I currently have a Frame that will host all of my pages. I am using myFrame.Navigate(PageToNavigateTo) in my CommandBinding Executed method when clicking a radio button. There are 8 radio buttons, one for each page. I am hiding the navigate next/back with this: NavigationUIVisibility="Hidden" This all works well and I can change pages when clicking the radio buttons. How can I bind content inside my frame's pages to elements on my MainWindow that are outside the frame? For example, lets say on page8 is loaded in myFrame . If I have a TextBox on that page and type some text in it. I want a label sitting outside of the frame on my MainWindow to update with that text. How can I do this? I try setting the DataContext of the frame and that doesn't work. I have a sample app working up to this point and could post it somewhere if that would help. Thanks in advance.

Proper Approach for Monthly PDF Reports for Small Business?

Hello, all. Previously, our environment included an installation of WSS 2.0.  One of our most widely-used "features" was a page of links to reports on network file shares.  No one liked or trusted the Document Libraries, so we continued to store our weekly & monthly reports at places like \\fileserver\r-drive\MonthlyReports\2010\08\Sales\LicenseActivationReport.pdf and then created a bird's nest of links on our WSS "Reports" page to allow folks to find the information they were looking for more easily.  I'm not talking about a Links List, but a page of text with about 30 links to individual reports whose locations changed at least monthly.  These reports are roughly 70% PDF (exported from Crystal Reports), 25% Excel, and 5% Word. Today, we have an installation of MOSS 2007 Standard.  The collaboration and document management features are taking off quite nicely, but the staff is understandably itching to migrate the above-described "Reports Page" from WSS 2.0 to MOSS 2007. I can think of a few different approaches to this situation: We could reproduce a text page with 30 links to places like file:\\server\share\report.xls, but this seems contrary to SharePoint's mission.  It's certainly contrary to what I told the staff during training:  "Don't turn SharePoint into a bird's nest of links to ext


Hi All, We are having string in the format of:- 'Xyz, Abc P.' 'Pqr, Lmn Q.' We need to split the the string and store into three different columns Expected O/p:- FirstName LastName MiddleName Xyz Abc P Pqr Lmn Q Thanks Regards, Kumar

GridView Pager not showing proper number of rows

I have created an out-of-the-box  (default everything) ASP.NET Dynamic Data Entities Web Site using VS2010, C# and the .NET Framework 4. Created an ADO.NET Entity Data Model based off a MS SQL 2008 R2 database and registered that EF data model for my dynamic data. Everything works great except for the one change I would like to make. By default, the GridViewPager.ascx file provides the values 5, 10, 15 and 20 in the dropdown for GridView's "Results per page" option. I would like to change that to 10, 20, 30 and 40 - with 40 being the default selected option. I went to the code behind file and modified it to have the values I am wanting. Those values now show in the dropdown, and work if I select them. Problem: when the page is first rendered only 10 rows will show. How can I change this? Any help would be greatly appreciated.   Thanks

Apply substring to date field

I have a gridview that has a field called TargetDate which is formatted as dd/mm/yyyy.  I want to substring the numbers out of the date.  So basically remove the '/'.  How do I do that?  I can't just substring(0,2) because sometimes the date is single digits, sometimes 2 digits.  I am using vb.net.   thanks  

using substring


in asp.net i get a string frm database in  a variable

frm that i need to check for a substring which exixst in another variable ,

the length of string substring  is not knwn

eg var1="hello.howr u.what"


var2 is a substring of var1 .

how do i check



generate xml in proper format; select statement


I have 4 tables ex.

dbo.beach --> which has info like
'beach_ID','beach_name', 'beach_description'

dbo.monitoring --> info like

dbo.monitoring_location --> info like

dbo.advisory --> info like

i want output is follwing format
    <Beachidentifier> xxx <Beachidentifier>
           <beach_name> XXX </>
                     <opendate> XXX </>

          <closedate> xxx </>

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