Passing Values String To String
Jun 10, 2011I am trying to get input from user then convert it into specific format and hold it in new variable. here is my code
[Code]...
I am trying to get input from user then convert it into specific format and hold it in new variable. here is my code
[Code]...
working on user input box , get any value as string and format it as 0000xx here is my code, but value not passing.
Dim dtmInputBox As String = ""
Dim strDTM As String
Do Until Not dtmInputBox = Nothing
[code]....
my input is like 20 and i want to get as 000020
I have a simple query but I am just not able to get it right. Have a look at my sample code below:
Sub Function1
My Code Here
Function2(Year,Month)
End Sub
Sub Function2(Year,Month)
Dim Str as String()
for 1 to 30
Dim MyDate As New Date(Year, Month, i)
Str = MyDate.DayOfWeek.ToString()
Next
Return Str
End Sub
how to use a String Array for passing Values
View 3 RepliesI am a total beginner to Visual Basic and have a project to conduct a survey for my company. The Answers of the users need to be populated to the database. So far, all I've managed to do is to define a string which will have the answer to be updated into the access table. How am I supposed to pass the value?
View 2 RepliesHow can I instantiate an anonymous object while passing the propertynames and values as string?
new With { .SomeProperty = "Value" }
new With { ".SomeProperty" = "Value" }
my goal was to have a string generator that runs through all possible values of a string eg.
Possible values:
abcd
Chars that need to be filled:
**
Outcome:
aa
ab
ac
[code]....
(I have cut out a section where it tries to write it to a doc file. (just the writting))What I was wondering is how would I improve several parts of this code?
1. The speed - Already In a background worker (I will write a delegate soon )
2. The chars that can be used with it because this only allows the preset ones I would like to be able to use other ones like � or Chinese chars etc.
3. general Code.
I am trying to use string.format on a url to pass several values into the string. It's probably a simple error but I cannot get the following code to work. It doesn't even build the string.
Public Sub getStockData()
Dim client As New WebClient()
Dim url As String
[code]....
What would be the fasted method of get a string list of all values within [] in a string of text? For example: [client_name], are you are doing today? My name is [my_name]. The list of strings would be:
[Code]...
I have a question regarding calling a C++ dll from vb.net.My C++ dll has a function that takes char **data (2D char array) as a parameter like this for example.
extern "C" int fn(char **y_data)
I create a hyperlink that when clicks generates a url like so:
[URL]
And I read it into a text box like so:
Me.txtTags.Text = CType(Request.QueryString("Tag"), String)
But the result of this is that the textbox txtTags will only contain C and doesnt have the ++. I tried [URL]and the # is missing as well. But if I look at the address bar these values are there....
I was fed up of having a duplicate method side by side so merged them into one. Both sent a request to another class.
vb
Private _messageFormats() As String = { _
String.Format(RegistrySettings.PMessageData, Identity, Topic, Body,
[code].....
I'm sure you've all seen this a lot before (in a variety of forms) but I think (hope) it's a bit different. <Not actual names of variables>I have two forms (form1 and form2). Form1 has 2 class-level variables, a string (m_String) and a collection(colCollection).Inside form1, the collection is loaded using a key. With an if-statement, the collection is matched to input (from a combobox) through the matching key.The chosen string from the collection is then passed to the m_String (confirmed with MessageBox.Show(m_String)
View 5 RepliesI'm calling unmanaged C++ Dll function from VB.Net project by usin dllimport attribute like this;
<DllImport("Injection.dll", CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Sub Injector(ByRef Client As String, ByRef Dll As String)
End Sub
I'm trying to establish a connection to my SqlDatabase while getting the connection string from a function. This will eventually lead to dealing with the appconfig file, but for now I'm just getting the basics established.
Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[code]....
I have the following code in child window which is working but what I want to do is instead of using response.write I want to use label control or to display all the filename like this:
music.pdf, inventory.doc
My Ultimate goal is to pass the values in string (e.g.: "music.pdf, inventory.pdf" ) to the parent window. How do I do it?
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
Try
'' Get the HttpFileCollection
Dim hfc As HttpFileCollection = Request.Files
For i As Integer = 0 To hfc.Count - 1
[Code] .....
I have two forms in my application. Form1 is shown on starting and when i hit button, both forms are shown but Form2 is in focus. Now thing what i need is to input some strings in Form2, then i need to send that string over send function from Form1. So when i click to Button in Form2 I need to transfer my string to Form1 and then use send function... I think this is easy but i didnt get any result with using Object (public property)...
View 15 RepliesI'm having difficulty passing a variables in a an array list. [Code] I have to pass the paramvals array to the function. The paramvals array contains the string but not the value of variable of that name. For example, parmaval(0) should contain the value of vSequence but it showing me that it contains string "vsequence".
View 3 RepliesI'm trying to use a string variable in StartInfo.Arguments of a process, but can't figure out the correct syntax.
[code]...
how can I get specific record there in report by passing string parameter from vb.net to crystal reports? For example - I have text box, button & crystalreportviewer there in my form. When user will use it he will write specific word there in the text box & click on view report button then it will automaticlly find out the specific record & show it there in report.
View 1 RepliesI know strings are immutable, so the minute you change a string reference's value .NET makes a brand new string on the heap. But what if you don't change the value of a string reference; rather, you simply pass it into a function ByVal -- does this operation copy the string value on the heap as well? My inclination is "no," but I'd like to confirm.
For example:
Public Function IsStringHello(ByVal test As String) As Boolean
Return (String.Compare(test, "Hello") = 0)
End Function
Calling program:
Dim myWord as String = "Blah"
Dim matchesHello as Boolean = IsStringHello(myWord)
I know passing myWord by value makes a copy of the reference to "Blah", but since I have not tried to change the string itself, would it make another copy of the string on the heap?
my users to view, send (via email), export SSRS reports. I have set up date parameter boxes with calendar drop down and they are able to send via email a URL link that would either display the report via ReportViewer or send a link that would let then view the report in Excel or PDF. This is working just fine. Now I just added another report with a procedure prompt using a text box. Report works fine when I run it in SSRS. If I enter say carotid stent, it displays all records that have the word "carotid stent" in the procedure name field. Now, when I added code using VS 2005 to accommodate this new parameter, here's my code -
ProcedureName = txtProcedureName.Text
msg.Body = "Please click on the URL link to view the report - " + Chr(13) + Chr(10) + "http://SERVERNAME/ReportServer/Pages/ReportViewer.aspx?%2fReports%2f" + ReportName +
[code].....
Can I do anything more or less with IDictionary? How do these two collections differ?
View 5 Repliesmy code is :
[Code]...
The error is Value of type '1-dimensional array of string' cannot be converted to 'String'.
How do I dynamically call a function with delegates by passing a string to a background thread in VB.NET?
Currently my code is this
Public Sub invertImageBK(ByVal image As Bitmap)
Dim snxl As System.ComponentModel.BackgroundWorker = createBW()
snxl.RunWorkerAsync(New ImageProperties(image.Clone, "invertImage", Nothing))
[Code].....
In a nutshell, I am selecting values from a checked box column in a grid view. After checking the boxes I have a function that concatenates each customer number into a string called @CusList to use a parameter for a stored procedure Public Function SelectCusList()
Dim CusShow As String
Dim CusStr As String
Dim CusList As String
CusStr = ""
[Code]...
I have a class and method exposed to a client asp.net app. The class looks like
<DataContract()> _
Public Class Class1
Private v_string As String
Private v_integer As Integer
[code]....
The method is declared as
<OperationContract()> _
Function GetStuff(ByVal bar As Class1) As String
In the client code I create an instance of Class1 and set the values for v_string and v_integer, but using Wireshark to look at the xml being sent to the server only a value for v_string is being sent as part of Class1. I'm guessing this is because it considers the value of v_integer to be null/not set. Here is an example of the client code.
Dim MyService as New Service1.ServiceClient
Dim test as New Service1.Class1
test.P_integer = 1
[code]....
how different types are passed/used since Integer is a intergral type and String is a class, but can't seem to work out what to do to fix the problem.
So I'm passing a masked telephone number in the form of (999)999-9999 to a Function that 'strips' the numbers out and puts them into a string that I then use in an Update SQL statement. So far I have the code below that of course doesn't do anything:
Function StripPhone(ByVal sPhone as String) as String
Dim i as Integer
Dim sStripped as String
[code]....
I have a public function that i use quite a lot in the program that im making, that takes a string in-between 2 values:
Public Function GetStringBetween(ByVal InputText As String, _
ByVal starttext As String, _
ByVal endtext As String)
[code]......
I have tried just about every format I have found, and I can not seem to get the string digits 0-9 to show up as "00 - 09". Now I do not want numbers 10+ to show up as 010, 011, etc. I also know there are (2) ways to format strings as well:Microsoft.VisualBasic.FormatandString.FormatI have tried all of the following with no[code]...
View 2 Replies