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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Reading values before and after a forward slash....

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net
 

Hi all,

How can we split values from one column? I have a column in table like "work Experience".

"02/03" Month and Year. I want to split that values and display in saperate labels.

after clicking edit button they are displayed on dropdown list. Similarly i want to do for Annual CTC column.The Split for annual CTC will be Total Sal in Lakhs and In Thousand.

Just want to write split function for that.How can i write and display?

If any one can get the answer plz replay me.

Thanks in advance.




View Complete Post


More Related Resource Links

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 ?


Reading values from data access component individually

  

Hi,

I am trying to pick data from the database through data access layer and use those values in different text boxes on the page.Basically on a click on the form, modal popup is planned to read the database and put the values into different text boxes which can be latter changed/ updated.

 What I am unable to do is accessing those values on the form itself progamatically. I will be thankful for any ideas and help.

My data access component is as follows:

cmd.Parameters.Add(

cmd.Parameters[

 

new SqlParameter ("@reg_id", SqlDbType.Int ));"@reg_id"].Value=reg_id;try

{

con.Open();

SqlDataReader

Error while reading values on postback

  
I have some problems with trying to read values on a postback.The fields, textboxes and dynamiclly created fields doesn't keep their values or I'm doing something wrong when trying to read the values. I get an error message: System.NullReferenceException was unhandled by user code  Message="Object reference not set to an instance of an object."  Source="App_Web_m-6qot6q"  StackTrace:       at Sikt.RäknaVärden() in C:\Visual Studio 2005\WebSites\Kalibreringscertificat\Sikt.aspx.vb:line 688       at Sikt.Button1_Click(Object sender, EventArgs e) in C:\Visual Studio 2005\WebSites\Kalibreringscertificat\Sikt.aspx.vb:line 892       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)       at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)       at System.Web.UI.Page.ProcessReque

Reading/storing values of checkboxlist in SQL (VB)

  

Hi there,

I'm trying to store multiple selected checkboxes from a single checkboxlist, but i don't know where to start.. Sealed
Imagine i have three tables: tbl_events, tbl_organisors and tbl_settings and i want to store the organisors of an event.

Each event can have multiple organisors, so each organisor should be added as a single row into tbl_settings.
I know how to bind tbl_organisors to a checkboxlist, but how do i store the results (meaning: add the rows to tbl_settings) ?

tbl_events: Event_ID (PK) and Event_Name
tbl_organisors: User_ID and user_name.
tbl_settings: Settings_ID (PK), Event_ID and User_ID

Checkboxlist:

<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SDS_Organisors"
DataTextField="User_Name" DataValueField="User_ID" RepeatColumns="2">
</asp:CheckBoxList>

SQLDatasource:

<asp:SqlDataSource ID="SDS_Organisors" runat="server" 
        ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>"

Reading in values in text file in a project solution to an array

  

Hi,

I have a tab delimited text file that has 6 columns (all integers) and 500 rows (and no column headings) called ProjectData.txt that I have added to my Windows Form Application (c#) (by added I mean I have it in my project solution). 

I have declared an array in my code called ProjectDataArray which has dimensions [500, 6].

I wish to load each column of each row into the array.

All the code I have seen shows how to do this for text files that are not included in the project solution. 

Is this easy to do?


Reading inner node values of xml

  

I have an xml file in the below format.

<?xml version="1.0" encoding="utf-8"?>
<UITemplate>
<HTML>tr</HTML>
<HTML>td</HTML>
<HTML>div</HTML>
<Control ID="Title" Editable="true" UserControlName="Title.ascx"  Visible="true" Enabled="true" ></Control>
<HTML>/div</HTML>
<HTML>hr</HTML>
<HTML>div</HTML>
<Control ID="Edit"  Editable="true" UserControlName="Edit.ascx"  Visible="true" Enabled="true"></Control>
<HTML>/div</HTML>
<HTML>/td</HTML>
<HTML>/tr</HTML>
</UITemplate>

I need to loop through each element and get the value.

Using XmlTextReader iam able to do that but  If the tag name is <Control> then i need to get values for ID,Editable,UserControlName,Visible etc.. after that again read node values only  if the node is <Content> it should read all the attribute values for  that <Content>.

Please help me out


Xpath query to find an Node who's attribute contains a forward slash - Going crazy

  

If  I have a .XML file that contains the following example:

<Socks Style ="Business/Business Casual/Casual"

</Socks

When I try to use the Xpath expression below to find the element above by searching for the value contained in the Style Attribute, the expression returns null:

//Socks [@Style='Business/Business Casual/Casual'] 

I downloaded xPath virtualizer and I noticed that the expression above is adding the namespace alias when it finds the embedded forward slash contained in the value of the Style Attribute (which is of course not what I want to happen).  This is driving me up a tree!!  Isn't there a way to escape the forward slash?  I know it is the slash that is the problem because for testing purposes I substituted dashes (-) in one of the nodes' Style Attribute values and then changed the xpath expression to match and it returned the exact node.

My goal is to do some replacements on all elements with the Style attribute based on each contents but I can't even try that because of this roadblock.

Please help anyone

-Rick

 


Determine node type selected in TreeView and reading property values

  

I am hoping that someone can help me get past some problems I am having when using the WPF TreeView control.  I have a TreeView that at most can have 3 levels.  The levels are defined as Project, Discipline, Person which would look like the following:

+ Project

    + Discipline

        - Person

My TreeView is bound to a database using two HierarchicalDataTemplate's and then one DataTemplate (the binding is done in the XAML).

What I would like to get is the following information when selecting an item:

  1. Read the selected value (text of the selected node)
  2. Reading Enclosure values and media:thumbnail values

      

    Hi I've been looking for a solution but I can not get any code that works, I want to read the URL values of the fields <enclosure and <media:thumbnail following you will find the rss feed and the vb code, I think Im missing something, but I dont know where

    <rss version="2.0"
            xmlns:media="http://search.yahoo.com/mrss/"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:flickr="http://flickr.com/services/feeds/"
            >
     <channel>
      <title>Content from Margarita</title>
      <link>http://www.flickr.com/photos/51374889@N00/sets/72157604607980332</link>
       <description></description>
      <pubDate>Fri, 18 Apr 2008 13:13:24 -0800</pubDate>
      <lastBuildDate>Fri, 18 Apr 2008 13:13:24 -0800</lastBuildDate>
      <generator>http://www.flickr.com/</generator>
      

Reading Web.Config to pass values to silverlight Application

  
In asp.net application we often use to save the connection string and some other information like user name , web service URL etc in the web.config and then in application read them and use in the application and even we can easily changes these value at later time.However, this scenario does not work out of the box from a Silverlight application, which doesn't seem to even have access to web.config.The reason is simple: a Silverlight application runs on the client side. The XAP -just like the browser- cannot access server resources such as web.config. In this post I will show you how you can read the web.config and pass to the silverlight application and then on the silverlight application how can you read the passed parameters.

Is a half-written values reading prevented WITH (NOLOCK) hint?

  

Is it possible to select half-written values WITH( NOLOCK) values and if not how is it (half-written values reading) prevented (if no locks are respected)?

Violation of which DBMS principle is reading of half-written value?
I am having difficulties in identifying its term (is it consistence, integrity break)?
What is the name of corresponding term?


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.

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

  
Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

XML Reading and Writing

  
We learned to process XML files using the Document Object Model as implemented by the XmlDocument class. To go further and make XML friendlier, the .NET Framework provides many other classes for different purposes, allowing you to create and manage nodes from custom .NET classes.
Besides the XmlDocument and the derived classes of XmlNode, the .NET Framework provides the XmlTextWriter class, which is derived from XmlWriter. The XmlTextWriter class works in a top-down approach to create, or deal with, the contents of an XML file. This class writes an XML node and moves down without referring

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

  

Hi,

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) {
Categories: 
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