Retrieve The Contents Of The Action Which Is Between 2 (single Quotes Rather Than Doubles)?
Mar 29, 2009
i'm having some trouble with most likely the simplest of reg ex i'm trying to get thew contents of a form: <form action='I NEED TO RETRIEVE THIS DATA' id="questionaire" method="POST"> i need to retrieve the contents of the action which is between 2 ; (single quotes rather than doubles) i have:
Dim regexSource As New Regex("(?<=action=.*?"").*?(?="")", _
RegexOptions.IgnoreCase Or RegexOptions.Singleline)
Dim regexSourceMatches As MatchCollection = regexSource.Matches(HTMLResponse)
[code].....
View 2 Replies
ADVERTISEMENT
Nov 9, 2011
Is there any way to use selectnode with the attribute having both single and double quotes? If we are having single quote in the attribute we can use like below,
nodeList = root.SelectNodes("//book[contains(title,""'attribute'"")]")
If we are having double quotes we can use,
nodeList = root.SelectNodes("//book[contains(title,'"""attribute"""')]")
how can I use an attribute ['attribute"] having both single and quotes in SelectNodes.
View 1 Replies
Oct 23, 2009
I use SqlParameters when executing database statements. I know that I can replace a single quote with two single quotes... but in the past SqlParameters took care of this for me. I have two projects.. in one, the SqlParameter does this and it handles single quotes fine, in another, it does not and I'm at a loss why (I even copied and pasted the code):
[Code]...
View 9 Replies
May 12, 2009
I have a problem with double and single quotes in a string.I have a textbox where i take a string from.In the textbox are double quotes and single quotes quotes.Problem is that if i return the string all the single quotes are replaced by double quotes.How can i get it to keep the single quotes as single quotes?
View 4 Replies
Apr 2, 2009
I have a table with many values inside of it that might have single quotes around them. I need to create a duplicate table without those single quotes. I can't modify the original table as I need to use it, 'as-is' later.
I've done this with a table.Clone and using a foreach to loop through the rows and columns removing single quotes as I need and then putting that new row into the new table. It works and it's straight forward.....but
I'd like to do the same thing using LINQ. This was my attempt....
Dim myResults = From myRow In dtTable _
From myItem In myRow.ItemArray _
Where TypeOf myItem Is String AndAlso _
myItem.ToString.StartsWith("'"c) AndAlso _
myItem.ToString.EndsWith("'"c)
I had trouble finding examples that weren't looking at a specific column in the DataRow. It looks like my code does pull back all the matching results - but I'm at a lose for how I can create a duplicate table/modify the values?
The only requirement is to not using a For Each; as I already know how to do that. I've gotten closer - but I still can't seem to create a new row or a new table.
My new approach hits a dead-end when I try to do this:
Dim MyNewRow As New Data.DataRow With {.ItemArray = myRemovedQuotes.ToArray}
The Error message I get says, "Error 1'System.Data.DataRow.Protected Friend Sub New(builder As System.Data.DataRowBuilder)' is not accessible in this context because it is 'Protected Friend'."
View 2 Replies
May 9, 2011
I have the following string [custID] = 'A99999999' I am trying the following to remove the square brackets and the single quotes Regex.Replace(sql, "/[[]']+/g", " ") but that's not working. I keep getting the same results Note: sql is a variable holding the string above. I want the result to be
View 5 Replies
Oct 5, 2011
The apostrophe is used to separate data when adding records to an Access Database data table using the "INSERT INTO" SQL statement. Having apostrophes in the data really screws things up with this new software. Is there a simple workaround? Is it possible to specify a different character? Is it possible to add data without using SQL Statements? I also noticed that the new OleDbDataAdapter Add Method generates the same SQL Error because it apparently creates an "INSERT INTO" SQL Statement.gh
View 4 Replies
Feb 14, 2011
I have a checked list box having some items .When I click any item it first select the item and then when I again click it then check box is checked/unchecked How to change this behavior means I want to perform selection and check/uncheck action in a single click.
View 4 Replies
Sep 22, 2011
I have a large file that I need to copy each lines contents and place between the quotes in sw.WriteLin (" ").
Sample text file
#
# Security Options
#
DisableMemoryCardInsert True
[CODE]...
View 4 Replies
Dec 27, 2011
This should create a desktop shortcut but instead it spits out an error that is because of the quotes inside quotes. They need to be there, I know this is the problem as I have tried without them and it has worked. Another problem though is that it creates the shortcut (when Idon'thave quotes in quotes) but wraps the whole TargetPath in quotes making the shortcut unusable. Here is my code:
Dim input As String
Dim s As String = Environment.GetEnvironmentVariable("UserProfile")
input = TextBox1.Text
[code].....
View 5 Replies
Nov 17, 2010
using the code below to save and reload the contents (text and images) of a Listview to a single file. The images are about 100x100 pixels.The problem is that if I save the images as JPG (they are already JPG when adding them to the ImageList/Listview), then after saving and reloading the data a dozen times, the images get distorted. When saving/reloading the images as PNG a dozen times, white spots starts to appear on the images. I guess this is because the images are converted over and over again when saving them.Is there a better to way save the contents of the Listview to a single file? I do not want to save the text and images seperately, because then the user has more to tamper with.
vb.net
<Serializable()> Structure TB_INFO
Public stdPic() As Byte
[code].....
View 5 Replies
Jan 12, 2011
I got a string array & I need to show the contents of it to a single label. It acts like a clock. The thing is I tried with everything I could but I failed. This is the code I've been trying. Its in vb.net. And theres a thread running to slow down the loop so I can display the contents in a label for 2 seconds.
Dim j As Integer
For j = 0 To readText.Length
label.text=readText(j)
Thread.Sleep(2000)
Next
View 5 Replies
Aug 25, 2010
I have a page where I would like to collect information about x number of users.I have a control where you enter in the number of users and based off of that number, I create a dynamic table with a row for each user.Each table row has textbox controls that I would like to retrieve the value from on postback.How can this be accomplished?
View 2 Replies
Feb 12, 2009
However I need to interact with a program designed in vb from perl (yes I MUST do it this way....)
The control I need to get text from has a class TL80.C1List32.20 I believe this is a listview. I can get a handle to the control just fine.
I have access to the SendMessage function via a wrapper with this prototype:
SendMessage( $hwnd, $msg, $wParam, $lParam );
(A $ denotes a variable in perl)
The listview also has 2 child windows of class: TL80.C1List32.20_SC
which I believe are scrollbars.
I need to retrieve (but not set) the items in this listview via the wrapped SendMessage function.
I can provide any other information you'd like from Winspy++ or can probably dig it up on my own if you let me know what you need.
View 1 Replies
Nov 4, 2011
Dim hmm As String
hmm = "HELLO"
Console.WriteLine(hmm)[code].....
The Output of this Code is HELLO But how should i get it in double Quotes as"HELLO" This has to be my output in double quotes.
View 4 Replies
Jul 22, 2010
I'm new to LINQ and am having a problem getting proper results from a simple (working) stored procedure that takes no parameters and returns a single Integer. When calling this sproc with LINQ its returnvalue is always 0. When run using tableadapter or directly on the sql server it works, returning 6 digit values like 120123.
Here is my LINQ code:
Dim MeetingManager As New MeetingManagerDataContext
Dim MeetingID As Integer = MeetingManager.NewMeetingID().ReturnValue Here is the NewMeetingID procedure:
ALTER PROCEDURE [dbo].[NewMeetingID]
AS
SET NOCOUNT ON
BEGIN
[Code]...
View 1 Replies
Feb 23, 2010
If I try to display a command line argument that has double quotes around, the double quotes are always stripped off. How can I avoid this?
for example, the argument is "c:xx.txt" and this displays c:xx.txt instead Console.WriteLine((My.Application.CommandLineArgs(4)))
View 4 Replies
Jan 28, 2010
I have an enum set with custom attributes. need to retrieve the attribute value in single statement ...
Public Enum Messages
''' <summary>
''' <value>(MessageText : Do you want to save ?)</value>
''' </summary>
<StringValue("Do you want to save ?")> Save
[Code] .....
Now I needed to retrieve the enum value like something below.
Messages.Save.GetType().GetCustomAttributes...... something is possible in single statement itself?
View 1 Replies
Mar 28, 2011
a datacontext defined in a module(domain services ado.net ria)a page having add/delete methods whenever any method is executed, it is found that all the previous actions (NEW RECORD ADDITION and DELETION OF RECORDS) are carried out before the new action is carried out normally
this behaviour is not prominent but "when using break points and inspecting the values of the variables and table object to be added to context, it is clear that all the previous actions take place again. even when the datacotext. savechanges is called, even after that still all actions carried out on the datacontext repeat themseleves, when any new action is to be carried out
View 1 Replies
Mar 20, 2010
I have a label that displays the result of a calculation, i.e lblTotalCost.Text = dTotalCost, where dTotalCost is a Double. When I try use FormatCurrenct(lblTotalCost.Text = dTotalCost), the program crashes and says unable to convert string to double.
View 2 Replies
Aug 5, 2010
I've got a heavily used web application that, for the first time in 2 years, failed doing an equality check on two doubles using the equality function a colleague said he'd also been using for years. The goal of the function I'm about to paste in here is to compare two double values to 4 digits of precision and return the comparison results. For the sake of illustration, my values are:
Dim double1 As Double = 0.14625000000000002 ' The result of a calculation
Dim double2 As Double = 0.14625 ' A value that was looked up in a DB
If I pass them into this function:
Public Shared Function AreEqual(ByVal double1 As Double, ByVal double2 As Double) As Boolean
Return (CType(double1 * 10000, Long) = CType(double2 * 10000, Long))
End Function
the comparison fails. After the multiplication and cast to Long, the comparison ends up being:
Return 1463 = 1462
I'm kind of answering my own question here, but I can see that double1 is within the precision of a double (17 digits) and the cast is working correctly. My first real question is: If I change the line above to the following, why does it work correctly (returns True)?
Return (CType(CType(double1, Decimal) * 10000, Long) = _
CType(CType(double2, Decimal) * 10000, Long))
Doesn't Decimal have even more precision, thus the cast to Long should still be 1463, and the comparison return False? I think I'm having a brain fart on this stuff...Secondly, if one were to change this function to make the comparison I'm looking for more accurate or less error prone, would you recommend changing it to something much simpler? For example:
Return (Math.Abs(double1 - double2) < 0.0001)
Would I be to try something like:
Return (double1.ToString("N5").Equals(double2.ToString("N5")))
View 3 Replies
Jul 14, 2011
I wonder, whats the proper, accepted way to convert doubles to strings? I've heard cstr(blah) is wrong (despite it working perfectly OK for me....), what is the proper way to do this say if I want to display the value of a double in a textbox (along with 'the answer is' or somesuch)?
View 1 Replies
Jun 8, 2011
Having problem make last if an statement work in the code. the variables in the if statment are doubles but the ide keep telling i need a proceeding if statement. but is already there it is in the last if statement of the code
Public Class Form1
Dim Totals As New List(Of Double)
Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
[CODE].....................
View 4 Replies
Jun 13, 2010
I am tasked with the job of reading the X and Y coordinate of a Text label from a "save file" of a 2D CAD drawing. I found the exact position of the coordinates in the file, but I still don't understand how to read them 100%. They aren't simple ASCII characters.First, I read the file byte by byte, and load them into a textbox seperated by spaces as numbers from 0 to 255. Here is an example X and Y coordinate
View 1 Replies
Jun 23, 2011
I have a bunch of type Double variables in my program, say for example
Dim Area as Double = 0
Dim Perimeter as Double = 0
Somewhere in my program I want to calculate these values, so I define
Public Sub TheSquare(ByRef TheArea as Double, ByRef ThePerim as Double, ByVal TheSide as Double)
TheArea = TheSide^2
ThePerim = 4 * TheSide
End Sub
and somewhere in the program I'm collecting side lengths and calculating the area and perimeter; say
While True
S = GetSideValueFromSomewhere()
TheSquare(Area, Perimeter, S)
End
In my real program, I have, say, 20 quantities that I want to calculate. Obviously each one has a different equation. But in the end I want to output all 20 to a file, so to save typing, I create an array of the quantities, like this:
Dim TypingSaver() as Double = {Area, Perimeter}
so that I can dump values to file with a three-line for-loop instead of copying and pasting 20 variable names.
This does exactly what I want if Area and Perimeter were reference types like Objects. But since they are Doubles, TypingSaver contains only their values, not references to the actual variables. So after I use my TheSquare function the values of Area and Perimeter are correctly updated but TypingSaver just constains whatever the values of Area and Perimeter were when I declared the array.
how can I create an array of references to doubles in VB.NET?
View 3 Replies
Dec 16, 2011
I have a dataset (imported from a XML file) with double records (clientname), and I want only the records with the most recent date (datetime field) written to a SQL database. Now I sort the dataset ("clientname ASC, DateTime ASC"), so the newest entry is written to the database.
[Code]....
View 5 Replies
Sep 14, 2009
could anyone show me a code on how to transpose a two dimensional array of doubles (changing rows to columns and vice versa) ?
View 1 Replies
Mar 30, 2011
I have the following code in vb.net that calculates the amount before tax was applied:
Public Shared Function CalculateRateBeforeTax(ByVal rate As Decimal, ByVal tax As Decimal) As Decimal
Dim base As Decimal = rate / (1 + (tax / 100.0))
Return Math.Round(base,2)[code]....
I put the above scenarios into some unit tests using c# and using the nunit testing framework. The first scenario passes, but the other fails and I am not sure how I can get it to pass. Here is are my tests:
[TestFixture]
class TaxTests
{[code].....
As I said before, the first test passes, but the results of the other tests are:
Second Test expected 305.1600000000000003d But was: 305.1643192488263d
Third Test expected 95.54999999999997 But was: 95.55555555555555557d
View 4 Replies
Sep 9, 2009
the Threading.Interlocked class provides; I don't understand, though, why the Add function only offers two overloads: one for Integers, another for Longs. Why not Doubles, or any other numeric type for that matter?Clearly, the intended method for changing a Double is CompareExchange; I am GUESSING this is because modifying a Double is a more complex operation than modifying an Integer.
View 4 Replies
Feb 6, 2012
I need to define a property in my class which is an array (of doubles).My original (bad) version is this:
Public Class Market
Property Correlations0 As Double
Property Correlations1 As Double
Property Correlations2 As Double
[code].....
This however doesn't work. I get an error already at design time: "Public Property Correlations as Double has no parameters and its return type cannot be indexed."What should I do with it? I also do not know in advance how large the array should be (the array size is determined at runtime based on other properties).
View 8 Replies