Hi, i have the below code var copy = "CATCOMETACISTCASEATCORACT"; var reg = /(CAT)+/; var sd = copy.match(reg); sd returns me only array with values [CAT,CAT] but i need diff combinations like "CAT","CTA","TAC","ACT","ATC","TCA" wat should the exact regular expression for the above result...
siva455
Posts
-
find words from group of letters in a statement using regularexpression -
get the file path in web project when running unit test projectActually im getting error when the below code is executed from unit test project... where import is an xml file in the below code.. XmlTextReader importReader= new XmlTextReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/Importcontent/import")); the above code is present in one of the methods in different project(class library) which is used in test method in the unit test project where as the above path is present in web project. and the value of the System.Web.Hosting.HostingEnvironment.MapPath("~/Content/Importcontent/import") is null..ie unable to get the complete path of the file i guess bcos the hostingenvironment is not running(web project) The above code is working fine when running from the webproject ie it returns the exact path. whereas returning null value when running from test project. please let me know how to fetch the file path(where file is present in web project) when running from test project.
-
get the file path in web project when running unit test projectActually im getting error when the below code is executed from unit test project... where import is an xml file in the below code.. XmlTextReader importReader= new XmlTextReader(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/Importcontent/import")); the above code is present in one of the methods in different project(class library) which is used in test method in the unit test project where as the above path is present in web project. and the value of the System.Web.Hosting.HostingEnvironment.MapPath("~/Content/Importcontent/import") is null..ie unable to get the complete path of the file i guess bcos the hostingenvironment is not running(web project) The above code is working fine when running from the webproject ie it returns the exact path. whereas returning null value when running from test project. please let me know how to fetch the file path(where file is present in web project) when running from test project.
-
populate dictionary from the intersection of two list collectionsHi, I have a list like List> X where Items is a class... and another List like List Y where StudentTasks is a class which contains two variables PersonnelNumber(int),Iseligible(bool)....... In the above list X contains personnelnumber(int) which is the key for each list member in X... In the above list Y contains personnelnumber(int) which is one of the variable in each list member (ie StudentTasks )... actually the personnelnumbers in X were the subset of personnelnumbers present in Y which even contains personnal numbers other than in X....So as now Please let me knoiw how to fetch personnelnumbers from Y(which were present in X) and the associated Iseligible values from Y... and need to create a new Dictionary like var q=new Dictionary() where this should be populated with values from the above resultset...ie...key as personnelnumbers and iseligible as value....
-
Declare TimeStamp in dbmlI have an Sp which takes a userdefinedtabletype as one of the parameter,and now i need to call this Sp from my c# code. I created a dbml file and i created a class which simulates my userdefinedtabletype in DB. Now the issue is there is a column named **version** which of type TMESTAMP is present in the Udtt in SP And the structure of udtt in DB is as follows. CREATE TYPE dbo.sampletype as ID INT NULL, Name String NULL, Version TIMESTAMP So when i created a class i created VERSION column as below.. global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Version", DbType="rowversion NOT NULL")] public System.Data.Linq.Binary Version { get { return this._Version; } set { if ((this._Version != value)) { this._Version = value; } } } Now when i call SP using classic ADO.net(using cmdparameters,SqlExecuteReader) im getting the below error.. The type of column 'Version' is not supported. The type is 'Binary' Please help me regarding the same.
-
Confirm dialog with OK ,CANCEL buttons on window closeHi, i have an popup which is an aspx page and when i click on browser close button..., the system should check if there is any unsaved data in the form or not. If there is any unsaved data then the message should be displayed (Do you want to leave..?) with OK and Cancel button... On click of the OK button, the data should not be saved and the user should be returned parent form ie popup should be closed and return to the parent form.On click of the cancel button, the control should return to the Pop. I had tried the below code... window.onbeforeunload = close; function close() { var result=confirm("Do you really want to close this window"); if (result) { return true; } else { location.href = document.URL; } } The above code is not working ie the popup is getting closed even on click of closse button.... and when clicked on OK it is dispalying another msgbox with leave this page and Stay on this page buttons... Please help me regarding the same...
-
Issue with Imultiple ResultsHi, suppose my SP returns 8 results sets i want to fetch only the 8th resultset....the issue which im facing with IMultipleResults.GetResult<> is it is not able to give the 8th resultset...and i need to call all the 7 resultsets before i call 8th resultset....and please let me know how to fetch the 8th resultset directly.... As this is possible in classic ado.net using tablemapping to fetch the desired result set ...please let me know how this can be achieved using Linq to Sql.. And i can"t chnage as my SP is used across other places of code where they coonsume some of the resultsets in 8 resultsets.... Please suggest me is there a way to fetch only the particular resultset from SP...
-
Issue with Imultiple result setsThanks for ur solution...but as my SP used across other places of code where they coonsume some of the resultsets in 8 resultsets.... Please suggest me is there a way to fetch only the particukar resultset from SP...
-
Issue with Imultiple result setsHi, suppose my SP returns 8 results sets i want to fetch only the 8th resultset....the issue which im facing with IMultipleResults.GetResult<> is it is not able to give the 8th resultset...and i need to call all the 7 resultsets before i call 8th resultset....and please let me know how to fetch the 8th resultset directly.... As this is possible in classic ado.net using tablemapping to fetch the desired result set ...please let me know how this can be achieved using Linq to Sql..
-
Linq to Sqlactually i cannot change my sp ,bcos this is used in many other places of code they fetch particular resultset which i require.... so please let me knoiw is there a way to fetch only the resultset i need from sp using Imultiplerersults..... As this is achievable in classic ado.net using tablemappings where we can fetch the desired resultset from SP. please let me know how this can be achieved in Linq to SQL....
-
Linq to Sqlya thats true but that is not giving me the desired result, we need to fetch other results also prior to this(need to follow the sequence of result sets returned from the sp)..if my result is last one in the SP.....
-
Linq to SqlThanks for ur solution....but please let me know whether is it possible to fetch only the desired single result from the SP"s result set...
-
Linq to SqlHi, I have a Stored Procedure in SQL server which returns multiple tables... using IMultipleResults in Linq to SQl is there a way to fetch only one table from the result ....Please help me regarding the same....
-
Dependency InjectionHi, If possible Please explain me DI with very simple example. Even share me if u have any ppt for the same.....
-
Check for Null or Empty In SPHi, Please let me know how can i check whether the i/p parameters were Null or empty and raise error and let user know that particular parameter is null or empty when he is trying to execute the SP (Stored procedure)....
-
positioning issue in IE9Hi, i have used the below css class to display menu(onmouse over of a button)
.p-menu
{
z-index: 50; position:absolute; display: none; top:0px; left:0px;
}the above works fine in IE8 where as in IE9 it goes top left corner of the browser.... please let me know any suggestion...
-
Partial views(.ascx) in MVC in vs2008 or 2010hi, Please suggest me some basic samples to create and use uercontrols(partial views) in MVC in vs2008,2010 as im to find the same in google...
-
resolving class using interface using UNITY container to implement ioc pattern????Hi, please let me know the concept of Resolving class using interface using UNITY ... with a simple example.... Just want to know the advantage of using this design pattern(Ioc)...and how does it makes difference from normal approach...and the the basic idea of why to use unity framework...
-
pass data between different views in MVC in c#.netHi All, Suppose if i have a dropdown in a view page and if i select any value in the dropdown and the selected value needs to be passed to the different view. please let me know how is it possible.(with an example) Thanks in Advance.
-
Get all the values from HttpContext.Current.CacheHi , please let me know how to Get all the values from HttpContext.Current.Cache as i doesn"t know the keyname to specify in get method of HttpContext.Current.Cache... ie HttpContext.Current.Cache.Get