|
|
|
use int.TryParse to turn your string into a number, and ToString to turn the result back into a string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Does google not work where you are ? I gave you all the keywords you needed to find what you wanted.
dim i as int
if int.tryparse(textbox1.text, i out) then
i += 27
textbox2.text = i.tostring()
end if
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
man can you chat me online at yahoo!???
|
|
|
|
|
This is my select statement
Dim mySelectQuery As String = "Select id,ClosedDate,Status,RecvdDate,SUrgent,EValue,GroupName,owner,CallDesc From vwHeat where recvddate >='" & startDate & "' and GroupName ='" & ListBox1.SelectedItem & "'"
In my database,some data in CallDesc in not in the same line eg.
My name is Rigard.
My surname is Mossi.
I write all the above data in a .cvs file.
I want this to appear as :
My name is Rigard. My surname is Mossi. in one line.
But when it get to my .csv file, it writes "My name is Rigard" in one line and "My surname is Mossi in the nest line"
How can I make this to be in one line in my .csv file?
|
|
|
|
|
By removing the Environment.Newline that's obviously contained in the string in your database.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i have this code :
private Sub DataGridDesign()
Dim ts As DataGridTableStyle
ts = New DataGridTableStyle
dataGrid1.TableStyles.Clear
ts.MappingName = "Printers"
Dim TBC As DataGridTextBoxColumn
TBC = New DataGridTextBoxColumn
With TBC
.MappingName = "Print"
.NullText = "לא קיים "
.HeaderText = "מדפסת"
.Width = 200
End With
ts.GridColumnStyles.Add(TBC)
dataGrid1.TableStyles.Add(ts)
ts = Nothing
TBC = Nothing
End Sub
and here i do the call to this function:
private Sub MainFormLoad(sender As Object, e As System.EventArgs)
Call ConnectDgToDB()
call DataGridDesign()
call ConnectCompToDB()
call ConnectIdToDB()
call ConnectEmpToDB()
End Sub
but its dont do well i dont know what is the problem that i cant succses to fix this problem ,ther is no chane in the datagrid i hope that i accept the solution know
|
|
|
|
|
jeryes danial wrote: but its dont do well i dont know what is the problem
Neither do we. What do you mean by "it dont do well"? What is it supposed to do and what is it doing that's wrong?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I have 2 applications. In application 1 have a developed a simple setup wizard where the user has to enter some details. After they click next to continue and enter some more details. After they have done that, they will click finish. And Application 1 will call the setup of application 2 to install application 2
Application 2 will execute this line to install application 2
returnType = Shell("C:\Application2\setup.exe", AppWinStyle.NormalFocus, True)
The problem I have is that I will have 2 deployments, with the same name (setup). I wonder if it would be possible to merge these together, to make 1 setup.
I hope you can understand,
Many thanks in advance,
Steve
|
|
|
|
|
No, you can't combine 2 .EXE's into one.
steve_rm wrote: The problem I have is that I will have 2 deployments, with the same name (setup).
What do you mean by this? You'll have to files with the same name is what? An .MSI installation you're making?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi guys,
I'm using DataTable, DataRow, and DataColumn on my DataGrid, and i wonder how can i programmatically set the width of a certain column on my grid.
Any code on workin on these three?(Data/Table,Row,Column) to set the width of a certain column?
Thanks in advance...
-::maximus::-
|
|
|
|
|
A datatable is a construct that contains data, NOT formatting information. You set the widths on your DataGrid itself.
Are you using it in ASP.NET, or in Winforms ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Imports mshtml
Imports SHDocVw
Imports Automation
Imports InternetMacros
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(552, 341)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim wbbrowser As New SHDocVw.InternetExplorer
wbbrowser.Visible = True
wbbrowser.Navigate("http://elf.meterpower.co.uk/login.asp", Nothing, Nothing, Nothing, Nothing)
Do
Loop Until Not wbbrowser.Busy
LoginIntoSite(wbbrowser)
OpenDownloadDataPage(wbbrowser)
Dim iim As New InternetMacros.Apps
End Sub
Public Sub LoginIntoSite(ByRef wbBrowser As SHDocVw.InternetExplorer)
Dim HTMLDoc As mshtml.HTMLDocument
Do
Loop Until Not wbBrowser.Busy
HTMLDoc = wbBrowser.Document
Dim iHTMLCol As IHTMLElementCollection
Dim iHTMLEle As IHTMLElement
Dim str, groupid, password, userid As String
iHTMLCol = HTMLDoc.getElementsByTagName("input")
'Type Groupid
For Each iHTMLEle In iHTMLCol
If Not iHTMLEle.getAttribute("name") Is Nothing Then
str = iHTMLEle.getAttribute("name").ToString
If str = "groupid" Then
iHTMLEle.setAttribute("value", "")
Exit For
End If
End If
Next
' Type the userid in the password text box
For Each iHTMLEle In iHTMLCol
If Not iHTMLEle.getAttribute("name") Is Nothing Then
str = iHTMLEle.getAttribute("name").ToString
If str = "userid" Then
iHTMLEle.setAttribute("value", "")
Exit For
End If
End If
Next
'Type the password in the password textbox provided
For Each iHTMLEle In iHTMLCol
If Not iHTMLEle.getAttribute("name") Is Nothing Then
str = iHTMLEle.getAttribute("name").ToString
If str = "password" Then
iHTMLEle.setAttribute("value", "")
Exit For
End If
End If
Next
' Press the submit button
For Each iHTMLEle In iHTMLCol
If Not iHTMLEle.getAttribute("name") Is Nothing Then
str = iHTMLEle.getAttribute("name").ToString
If str = "Enter" Then
' If iHTMLEle.outerHTML = "<=href" & _
' " height=21 width=26 " & _
'"border = 0 > " Then
iHTMLEle.click()
Exit For
End If
End If
Next
Do
Loop Until Not wbBrowser.Busy
End Sub
Public Sub OpenDownloadDataPage(ByRef wbBrowser As SHDocVw.InternetExplorer)
Dim HTMLDoc1 As mshtml.HTMLDocument
Dim iHtmlCol As IHTMLElementCollection
Dim iHtmlEle As IHTMLElement
Dim iHtmlIn As mshtml.HTMLInputElement
Dim str1 As String
Do
Loop Until Not wbBrowser.Busy
HTMLDoc1 = wbBrowser.Document
iHtmlCol = HTMLDoc1.getElementsByTagName("a")
' Press the anchor tag to open DownloadData page
For Each iHtmlEle In iHtmlCol
If Not iHtmlEle.outerText Is Nothing Then
If iHtmlEle.outerText.ToLower = "Download Data".ToLower Then
iHtmlEle.click()
Exit For
End If
End If
Next
'Select Radio Buttons . I am using this code to select radio button
'by name demcons and value is kwh. The html code for radio button is as
'follows
For Each iHtmlEle In iHtmlCol
If Not iHtmlEle.getAttribute("name") Is Nothing Then
str1 = iHtmlEle.getAttribute("name").ToString
If str1 = "demcons" Then
MsgBox("hi")
If iHtmlEle.outerHTML = " " Then
iHtmlEle.click()
' MsgBox("hi")
Exit For
End If
End If
End If
Next
' iHtmlCol = HTMLDoc1.getElementsByTagName("input")
' For Each iHtmlIn In iHtmlCol
' If iHtmlIn.name = "demcons" And iHtmlIn.value = "KWH" Then
'iHtmlIn.select()
' End If
' Next
Do
Loop Until Not wbBrowser.Busy
End Sub
End Class
Satishk
|
|
|
|
|
As far as I can see, you've posted way too much code, and no question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am extracting data from SQL Server to .csv file using VB .net. Some data in the database are separated by enter eg. They used an application to enter the data so when they entered in a list box the pressed enter to go in to a new line.
So, when I extract the data to .csv file, the data after enter they appear in a new cell and not in the same cell as the rest.
How can I remove the ENTER space using vb .net?
|
|
|
|
|
Either the code that produces the CSV file is incorrect, or the code using the file is. If the file is created and read correctly, a newline is perfectly valid inside the data of a field.
A field value should be quoted when it contains a newline. Example CSV data:
Id; Info; Time
1; Hello there; 2006-09-26 18:36:20
2; "This
is
a
perfectly
valid
CSV
file"; 2006-09-28 09:51:12
Note that the values in a 'comma separated value' file often is not separated by commas at all...
---
b { font-weight: normal; }
|
|
|
|
|
Look into the String.Trim[^] method to remove any whitespace characters from the beginning and end of a string before you write the data out to the CSV file.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How do i change the size of all the controls in the VB.Net 7.0 application
I need your help.
|
|
|
|
|
Do you mean at design time or run time ? I'll assume run time. If you set the anchor property on your controls, they will resize with your form. Otherwise, you can set the X, Y, Width and Height properties on the controls manually, if you need to ( you usually don't ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to add buttons in GIF format from net to application
I need your help.
|
|
|
|
|
Do you mean animated GIFs ? To do that, you need to download or write code that animates GIFs, there is an article on this site, but in C#, I think.
To load a standard GIF, Bitmap.FromFile will work fine.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
New to programming, about 5 to 6 weeks of class.Question is what is the code for incrementl loops(to auto increment a primary key value)
This is what i want.
|
|
|
|
|
I nearly deleted two of your posts. Try to give your posts subjects that actually mean something, although you should mention the VB version in the text of your post.
You want to write a loop which increments a primary key ? A primary key is a value in a database, I doubt this is what you mean. Do you just mean a simple loop ? You've had 6 weeks of classes, right ? And google works on your machine ? Have you bought any books on VB ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|