.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

what can be used for pure text string in vb.net (it is @"string" in c#)

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

I am trying to dynamically create an xml file in vb.net, please look at the code below ;

            Dim detay As XmlElement = doc.CreateElement("title")
            detay.InnerText = "<![CDATA[<p><span class='footer' >Urun  No:8232-3   <a href='www.lasagrada.com.tr'>URUN DETAYLARI</a> icin lutfen web sitemizi ziyaret ediniz <a href='www.lasagrada.com.tr'> CANLI DESTEK </a></span></p>]]>"

            Dim detay As XmlElement = doc.CreateElement("title")

         detay.InnerText = "<![CDATA[<p><span class='footer' >any info <a href='anylink'>.....</a> sometext <a href='anysite'> teachers </a&

View Complete Post

More Related Resource Links

How to read a column of a sharepoint list to a text string field of infopath form?

My infopath form used to read these email addresses from a web service and web.config file. Now i would like to get these user email addresses from a contact list in a sharepoint server. I am trying to do this without writing any codes. Here is what i have done so far: 1. Adding a new "data connection to receive data from SharePoint library or List" where i selected Email Address column of the contact list. 2. I added a new Text Field and define a new rule with "Query using a data connection" defined above. When i try to access the newly created Text field above it always return empty as if the Query attached to it did not executed at all. What did i do wrong? Is there a better way? Thank you in advance for your help.

Cleanest way of setting max string length for text in GridView cells?

I want to make sure that each row in the table is the height of one line of text only.  I know you can set RowStyle-Wrap="false", but I also don't want any really wide rows.  I know I can go through each cell on RowDataBound or something and cut it to a particular length and then append an ellipsis on the end, but is there a neater way of doing the same thing?

C# .NET using a plain text string for a DESCryptoServiceProvider KEY and IV

Can someone please give me a solution to my problem below: I have this file encryption / decryption code which I found in the help docs... Well, all I want to do is use a custom 8 char password with the code... But I keep on getting this error: An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll Additional information: Specified key is not a valid size for this algorithm. What encoding should be used for the string to work? This line gives the error: DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey); Please help me with a solution: using System; using System.IO; using System.Security; using System.Security.Cryptography; using System.Runtime.InteropServices; using System.Text; namespace CSEncryptDecrypt { class Class1 { // Call this function to remove the key from memory after use for security [System.Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint = "RtlZeroMemory")] public static extern bool ZeroMemory(IntPtr Destination, int Length); // Function to Generate a 64 bits Key. static string GenerateKey() { // Create an instance of Symetric Algorithm. Key and IV is generated automatically. DESCryptoServiceProvider desCrypto = (DESCryptoServiceProvider)DESCryptoServiceProvider.Create(); // Use the Automatically generated key for Encryption. return ASCIIEncoding.ASCII.Get

Need to convert query string(date - 09/15/2010) to a text format - yyyymmdd

I am fairly new to C # and need some assistance with a form page.  I have created a simple form that requires the user to select a beginning date and ending date.  I then pass the values to my code behind page via query strings.  I have them passing, but I need the format to be change to a different format.  Unfortunately the database does not use the standard date format.  It requires the date to be in a text format as YYYYMMDD.Form: <tr> <td> Beginning Date:</td> <td><asp:TextBox runat="server" ID="begDate"></asp:TextBox> <asp:Image ID="Image2" ImageUrl="~/images/calendar_schedulehs.png" runat="server" /></td> </tr> Code Behind: protected void createReport_Click(object sender, EventArgs e) { StringBuilder url = new StringBuilder("Report/TopCustomer.aspx?"); url.Append("BegDate=" + begDate.Text); url.Append("&EndDate=" + endDate.Text); url.Append("&Brnch=" + ddlLocation.SelectedValue); Response.Redirect(url.ToString()); Current URL: TopCustomer.aspx?BegDate=09/15/2010&EndDate=09/30/2010&Brnch=300I need to have the above URL change to:TopCustomer.aspx?BegDate=20100915&E

How to: textbox text should show only the last part of the string

Hi, I have a textbox that shows info. (filename) When the filename is smaller than the width of the textbox all is fine, but when the filename is longer, i would like to show the last part of the filename in stead of the first part (default). Is this possible?

extract date from text string - Transact-SQL

Hello, I have a field in my database with an archived date... (Giampaoli  Live Oak, Almonds Archive 09/16/10) I need to be able to extract the date from this, then perform a datepart function on it... How do I extract the date into it's own value using just SQL? Thanks, Wes

Problem extracting the middle characters of a text string


I need to extract a portion of text from one field and put it in another field and I am having trouble with the syntex.  I am doing this with an sql select statement in asp.net. 

I can select the left most characters of the field (SELECT  BatchNumber, LEFT(BatchNumber, 3) AS Expr1 FROM  DonorHistory) or the right most characters of the field (SELECT BatchNumber, RIGHT(BatchNumber, 3) AS Expr1 FROM DonorHistory) but I cannot select characters from the middle of the field.  I expected that to be able to use a statements such as "SELECT BatchNumber, mid(BatchNumber, 3, 2) AS Expr1 FROM DonorHistory" but this statement gives me an error.  I also tried using middle in place of mid but that did not work either.

What am I doing wrong?





Importing text file datetime string into SQL datetime column



Using SSIS 2008 R2 to import text files.  Two of the fields contained are datetime values in the format "2010-09-24 18:58:29.220".  Ultimately both the date and time need to be extracted with precision to the second, at the very least.  When I import the text file, however, the time value seems to get truncated before the date value's being imported, for an imported result of "2010-09-24 00:00:00.000".

Is my problem with the Flat File Connection Manager?  Regardless of which DataType choice I use for the properties of my datetime values--I've tried every form of date datatype--the imported column values contain the correct date but the wrong time value.

Is there an easy way to import a text file datetime value straight into a datetime column?  Is it possible, or am I trying to shortcut what should be a proper process?


Importing text file datetime string into SQL datetime column



I'm importing a text file into SQL Server 2008 R2 using SSIS 2008 R2.  Included in the text file is a datetime column with values like "2010-09-24 18:58:29.220".  However, when I import the file, the stored value has the time portion replaced with what I assume is the default, such as "2010-09-24 00:00:00.000".

Is there an easy way to import a datetime value from a text file into a datetime column in my table?  I've tried every form of date datatype in the Flat File Connection Manager, but I still keep getting the correct date portion with the incorrect time portion.

Am I trying to do something that wasn't intended?  I see Todd McDermid's page (http://toddmcdermid.blogspot.com/2008/11/converting-strings-to-dates-in-derived.html) and am starting to wonder if perhaps I'm trying to shortcut something that I shouldn't.


OPENROWSET 'Provider String' Documentation? Firstrow for Text Driver, Column names in 3rd row


I'm using sql server 2008 r2 express and want to write a script to load data from some csv files.


The following gets me close:




        'Driver={Microsoft Text Driver (*.txt; *.csv)}; DEFAULTDIR=C:\Data\QOL;Extensions=CSV;',

        'SELECT * FROM RegistrationData.csv')


The problem is that the that the first two lines are not data (Report Name and time generated) and the third line is the column names. If I manually open the file and delete the first two rows everything comes out perfectly. But there are a number of these files and it has to be done regularly so I want to automate the process.  BULK options allow a FIRSTROW option but that doesn't seem to work w/o the BULK option. Is there a way to effectively skip the first 2 lines w/o the BULK option (and its requisite format file)?

hyperlink text/now create string from label? please help



I have a datalist in a page which shows a username in a label from the database (theiruseridLabel)

I'm trying to take this username, find its profile.firstname and profile.company name, and then display them as the text in 2 hyperlinks.

i have the code below, but this doesnt work..? can anyone see why? there is no error, just the hyperlinks just show as 'hyperlink' rather than the names i want. Thanks!:

HyperLink hp2 = DataList1.Items[0].FindControl("HyperLink2") as HyperLink;
        HyperLink hp3 = DataList1.Items[0].FindControl("HyperLink3") as HyperLink;
        Label theiruseridLabel = DataList1.Items[0].FindControl("theiruseridLabel") as Label;

        string userName = Request["theiruseridLabel"];
        ProfileCommon userProfile = System.Web.Profile.ProfileBase.Create(userName, true) as ProfileCommon;
        hp2.Text = userProfile.FirstName;
        hp3.Text = userProfile.CompanyName;

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

Built-in Functions - String Functions

String functions let you extract various portions of character strings, change the case of strings, concatenate and reverse strings and perform many other types of manipulations. All built-in string functions are deterministic with the exception of CHARINDEX and PATINDEX

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

highlight string


i am looking for a function that takes two string parameters 

str1 = "hello how are you today mr john"

str2 = "how today"

and in return it shoud highlight the words "how" and "today".

Any ides? I prefer if its possible using reg expression...Thanks

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