.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

new with regex. returns no values. please help.

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
I have to pull out the content between(and including) every set of curly braces in a DownloadString. This is one sample that only has one set  of braces.[{"post_id":7046,"post_date":"2010-09-10 09:25:55","title":"Braking News: Keep Your Stopping Power","content":"<p>\r\n<object width=\"400\" height=\"320\" data=\"http:\/\/autonettv.com\/media\/mediaplayer.swf\" type=\"application\/x-shockwave-flash\">\r\n<param name=\"flashvars\" value=\"file=http:\/\/autonettv.com\/media\/BrakeService_Brittani_ChromaKey_Report_v3.flv&amp;image=http:\/\/autonettv.com\/media\/thumbs\/BrakeService_Brittani_ChromaKey_Report_v3.jpg&amp;autostart=false\" \/>\r\n<param name=\"src\" value=\"http:\/\/autonettv.com\/media\/mediaplayer.swf\" \/>\r\n<param name=\"AllowScriptAccess\" value=\"always\" \/>\r\n<\/object>\r\n<br \/><br \/> Richard Petty once told AutoNetTV, &ldquo;You&rsquo;ve gotta have good brakes. If you&rsquo;ve got good brakes you can keep yourself out of a lotta trouble.&rdquo; <br \/><br \/> That&rsquo;s why a regular brake inspection is on every San Francisco car&rsquo;s maintenance schedule. An inspection at <a title=\&

View Complete Post

More Related Resource Links

Dashboard Designer: KPI's - Scoring Pattern "Decreasing is Better" returns confusing values

Good day, I started using Sharepoint a few weeks back. I jumped straight into PerformancePoint Services, and have now now gotten the hang of it, r at least I think. Far from mastering anything though. Problem is: I have a table with three fields, namely ProjectName, ProjectBudget and ProjectCost put very simply. Say for example I have these records... ProjectName ProjectBudget ProjectCost Project A 15 000 20 000 Project B 10 000 20 000 Project C 15 000 15 000 Project D 15 000 10 000 Using ProjectBudget as my Target and ProjectCost as my Actual. How can I ensure that Project A and Project B are displayed as off target, while Project C and D are displayed as on target. Lastly, the percentages that are referred to in the "Thresholds" section, what are they referring to? Please let me know, if I need to provide more info. Thank you very much.  

Questions about creating a class that returns multiple values


Hey all,

I am a little stumped, been trying to find some references to this but I am coming up with more confusion than anything else.lol

Here is my scenario using asp.net and VB.

I have an aspx page with about 10 label controls on it and a couple of image controls. Their data will be all populated dynamically by a single URL query string that is passed to a 3rd party url query string that retrieves an xml document with all of the information on it. I am currently just using the page load event and from that I can get everything I need and populate the page elements no problem with all of the code existing on the aspx.vb page.

However I thought for this project as I go forward I would like to create a vb class that handles all of the work instead of using the code behind page which has become quit convoluted.

I am not completely new to creating classes, I've done them before, and some pretty complex however this one is new due to the fact that I want to return multiple values.

So my thought is to approach it this way.

1.       On the page load event I grab the URL query string, and pass it to the vb class to begin the process.

2.       In the class I create a function that loads the xml document into memory.

3.     &n

GridView Rowupdating Returns old Values


Haii all, my gridview row updating events return old values.. edititem templatefield gets its old value on row updation.

My code is as follows :-

      protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)

        TextBox tb1 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txt3");
        TextBox tb2 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txt4");
        TextBox tb3 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txt5");
        TextBox tb4 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txt6");
        TextBox tb5 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txt7");

        string s1 = tb1.Text;
        string s2 = tb2.Text;
        string s3 = tb3.Text;
        string s4 = tb4.Text;
        string s5 = tb5.Text;

        string qry="Update SparePartsStatus set Equipment='"+s1+"',Location='"+s2+"',TotalQuantity='"+s3+"',DateofDelivery='"+s4+"',Balance='"+s5+"' where (SpareName='"+Session["partno"]+"')";
SqlCommand com=new SqlCommand(qry ,con);
        int d = com.ExecuteNonQuery();


GetUserProfileByName method in userprofileservice.asmx returns null values when used in Service Refe


I'm using Silverlight 4 to call GetUserProfileByName method of the SharePoint 2007 userprofileservice.asmx web service. For each of the PropertyData in the e.Result object that is returned, the Values array is null.

Below is the Completed event handler. Execution gets inside the if block for each of the PropertyData.


void client_GetUserProfileByNameCompleted(object sender, GetUserProfileByNameCompletedEventArgs e)
 foreach (PropertyData prop in e.Result)
  if (prop.Values == null) // this is ALWAYS true for each prop


After some investigation, I've found out this only happens when userprofileservice.asmx is added as a Service Reference. I tested this out by creating an ASP.NET project. In it I added userprofileservice.asmx as a Web Reference, and then as a Service Reference. For the Web Reference case,

Named Set and Calculated Measure returns #Error values


I'm trying to create a set of measures that will give me a count of how many customer have bought a product that falls in to different levels in a heirarchy (Department -> Category )

I have a fact table that contains OrderDetail records at the SKU level.

My Product dimension contains the hierarchy assoicated to each SKU

My 3 measures are

Measure 1 -  number of items >= 1 and <= 3

Measure 2 - number of items >=4 and <=7

MEasure 3 - number of items >= 8

I have created a names set to cross join all the members in the product hierarchy with the customers





Given a Numeric range for a regex, how to get the minimum and maximum range values?


If I create a random regex that is restricted to numeric ranges (leading zeros included), how can I determine the minimum and maximum values of the range from the regular expression itself?

For example, if the range is 011 - 453 and I had this regex: ^0*(1[1-9]|[2-9][0-9]|[1-3][0-9]{2}|4[0-4][0-9]|45[0-3])$

How can I reverse engineer out of the regex the min value - 011 and the max value = 453.

I want this in order to create an error message dialog that would say, "The value must be between MIN and MAX".

How to Pass Values Between Web Pages ASP.NET

You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?

Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

jquery autocomplete multiple values


i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?


JQGrid Loading deleted values



This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.

Here is the code:

function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {

How to cast integer values as an array of enum values?


Hello all!

I'm working with VS2010 Beta2, ASP.NET and Dynamic Data. I'm using VB but will certainly be happy to receive a C# example if necessary. Laughing

I used a few of Steve's examples (Writing Attributes and Extension Methods for Dynamic Data and Dynamic Data - Hiding Columns in selected PageTemplates) to create a custom property attribute to be applied to a dynamic data column and want it to accept an array of enum values (each value will represent a dynamic data page template where this column should not be displayed).  My new attribute works fine when I hardcode it like this, meaning the HideColumnIn attribute is properly populated with the array of enum values:

<HideColumnIn(PageTemplate.List, PageTemplate.Edit)> _
Public Property My_DD_Column As Object


However, I want to store the values to be used for the HideColumnIn in the DB as integer values that correspond to the

Passing values in pages


Hi! Friends..

how to pass the value from one page to another page in asp.net  with out Using State Management Concepts?

Like 1. cookies


        3. QueryStrings

     With out using the above should pass the values...

how to bind Dropdownlist based on textbox values



I have one drodownlist which show data based om textbox values...

Let us consider i have 

Select Name from table1 where Type IN(@typ)

here @typ is textbox values

here for example textbox will have some thing like this L1,L2,L3..

How to filter Name based and shown in drodownlist based on this L1,L2,L3(on textbox)..

Help me in this

Unable to get all the values from a field


Am reading an XML from web service and storing in  a dataset. 
then in write to a DataTable as follows

 DataTable dtResult1 = dsSearch.Tables["RESULTSET"];    
 DataTable dtHIT = dsSearch.Tables["HIT"];     
 DataTable dtField = dsSearch.Tables["FIELD"]; 

The issue  is  in the DataTable dtField i can only see 3 columns FieldID,Name,HIT_ID

The corresponding values in the dataTable looks like this for the corresponding fileds


I am unable to get the Field Name values 1,8799f4646b6ed9acde142581a84f75a6 ,234B5F5F-F247-4EB6-9E39-A7B64C7FE1BD,Yes...etc

What would be the cause for this...Any Help

Below is the structure of the XML-

- <HIT NO="1" RANK="2955" SITEID="0" MOREHITS="0" FCOCOUNT="0"> 
<FIELD NAME="rank">1</FIELD> 
<FIELD NAME="internalid">8799f4646b6ed9acde142581a84f75a6 </FIELD> 
<FIELD NAME="contentid">234B5F5F-F247-4EB6-9E39-A7B64C7FE1BD</FIELD> 
<FIELD NAME="contentids" /> 
<FIELD NAME="collection&

Retreiving XML tag values



I'm new to xml.

Currently I'm using the SOAP service and MSXML2.ServerXMLHTTP40  to get data from a website.

To retrieve data I'm using the "responseText" method of the MSXML2.ServerXMLHTTP40 class.

My XML tree looks like this. ( part of the tree)


Just need to retrieve the value of the "projectName" & "dataID" from this.

Appreciate if somebody can help me to get the values of the above 2 fields with the relevant code.

Thanking you in advance.

reading values from config files in NUnit tests


One of my NUnit tests has to read in some values from config files.  In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in.  Ive tried putting app.config in my unit test project (I even tried web.config) but nothing seems to work.  Are there any special steps involved when reading from config files in an nunit test ?

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