|
You can take a test with empty textbox to write to database, to see if you can do in this way. And if you can, you can open the database file in Access to take a look what value is store in it.
|
|
|
|
|
Private Sub Form_Load()
Combo1.Text = "1&2&3"
'I want to display "1&2&3" but it displays "123"
End Sub
|
|
|
|
|
It should't (I paste that into a new form, add a combobox called combo1 and
run it and I get "1&2&3" displayed in it) are you sure you didn't put:
combo1.text = "1" & "2" & "3"
|
|
|
|
|
Hi there,
i have a program which check the url in database and using the http Response and request method it give me the out put whether the given url is valid r broken, my application work fine but when some url pass in this formate like "www.something.com/" my application is not working when url pass with the "/" pls help me how to solve this problem how to pass the url or how to truncate the slash "/"... pls give me some solution
This is the code snippet
------------------------------------------------------------------------
Public Function checkurl(ByVal url As String) As String
Dim req As System.Net.HttpWebRequest
Dim res As System.Net.HttpWebResponse
Dim r As System.IO.StreamReader
Dim ex As Exception 'error exeption holder
Dim pge As String 'page holder
Dim strreturnstring As String
Try
'display request url
req = req.Create(url)
req.AllowAutoRedirect = True
'set the user agent
'some site might brush you off if it is not set
'to stop bots and scrapers
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"
'get page
res = req.GetResponse()
r = New System.IO.StreamReader(res.GetResponseStream())
pge = r.ReadToEnd
r.Close()
res.Close()
strError = "OK"
status = "True"
'Convention is First Value is the Status and Second value is Errmsg
strreturnstring = status & "~" & strError
Return strreturnstring
Catch ex
status = "False"
strError = ex.Message
strreturnstring = status & "~" & strError
Return strreturnstring
End Try
End Function
--------------------------------------------------------------------
this is the code snippet for select from database
objConn.Open()
da = New SqlClient.SqlDataAdapter("Select SRNO, IDENTIFIER, TITLE, PHY_PATH as IDENTIFIER_URL," & _
" BROKEN_LINK_INFORMATION='', STATUS='' from web_resource where PHY_PATH like ''http://sunsite.berkeley.edu/''", conn)
da.Fill(ds)
Dim strValues As String
If ds.Tables(0).Rows.Count > 0 Then
For I As Integer = 0 To ds.Tables(0).Rows.Count - 1
strValues = checkurl(ds.Tables(0).Rows(I).Item("PHY_PATH"))
Dim strArrvals As String()
strArrvals = strValues.Split("~")
If strArrvals.Length > 0 Then
strError = strArrvals(1).ToString()
status = strArrvals(0).ToString()
End If
ds.Tables(0).Rows(I).Item("ERROR") = strError
ds.Tables(0).Rows(I).Item("STATUS") = status
Next
fncExcelExport(ds)
End If
-------------------------------------------------------------
regards
cyus
-- modified at 6:10 Sunday 25th September, 2005
|
|
|
|
|
'Pass your url in, and if it has '/' in tail, truncate it, if no '/' in the end, do nothing.
Public Function TruncIt(strUrl As String)
Dim pos As Integer
Dim len1 As Integer
If Len(strUrl) = 0 Then Exit Function
pos = InStrRev(strUrl, "/")
len1 = Len(strUrl)
If pos = len1 Then
'MsgBox "Trunc it."
strUrl = Mid(strUrl, 1, len1 - 1)
TruncIt = strUrl
Exit Function
End If
TruncIt = strUrl
End Function
|
|
|
|
|
Public Function Compl(strUrl As String)
If InStr(strUrl, "http://") <> 1 Then
strUrl = "http://" & strUrl
End If
If InStrRev(strUrl, "/") <> Len(strUrl) Then
strUrl = strUrl & "/"
End If
Compl = strUrl
End Function
|
|
|
|
|
Hi
I am new to Windows API programming and a relative newbie anyway, but need to accomplish a simple task - find out which API calls to make to see if a particular application is loaded and running and how to use them.
Could anyone supply the VB code to do this?
Thanks in advance
|
|
|
|
|
Do you have to use the api? You can use:
Dim count As Integer
count = Process.GetProcessesByName("Notepad").Length
Select Case count
Case 0
MessageBox.Show("Notepad is not running")
Case 1
MessageBox.Show("Notepad is running")
Case Else
MessageBox.Show(count.ToString & " Notepads are running")
End Select
|
|
|
|
|
|
Would like to know how to display the listbox item into datagrid.
Example : if i select a item(customer id) in the listbox, the datagrid would display the customer details.
|
|
|
|
|
To do this you must query everytime to the database..
e.g when you select customer id in the Listbox....query for the details in the database to find records against that customer id and display them in the grid as usual.....
Any problem?
_mubashir
|
|
|
|
|
Greetings,
Really hope that someone can throw me a clue on this!!
I developed a vb.net application that will use a dll built by MATLAB. Base on the code below, TEST is the dll name and an error occured while the application trying to execute this line ==> "objCount.test2(1, objOutput, A)"
Dim objCount
objCount = New TEST.countClass
objCount.test2(1, objOutput, A)
Error:
An unhandled exception of type
" 'System.Runtime.InteropServices.COMException' occurred
in SAMPLE.exe
I tried to set the system path variable. But, I still fail to solve the problem. Any expert out there could enlighten me?
Thank you.
-- modified at 3:59 Sunday 25th September, 2005
|
|
|
|
|
hey,
i need to communicate between processes in the same system using VB .Net. I was looking at shared memory, but am not sure how to implement it. I am new to this stuff and hence wud appreciate ur help.
thanks,
kalyan
|
|
|
|
|
I'm trying to make a program that sends data to another computer throught a net.
I have follow an example but I can not establish connection.
In the sender, I have this code:
'CREAR EL SOCKET Y CONECTAR<br />
Dim iphe As IPHostEntry = Nothing<br />
iphe = Dns.Resolve(server)<br />
<br />
Dim ipad As IPAddress = iphe.AddressList(0)<br />
<br />
ipad = iphe.AddressList(0)<br />
Dim ipe As New IPEndPoint(ipad, port)<br />
Dim tmpS As New Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp)<br />
<br />
tmpS.Connect(ipe)<br />
<br />
'******************************************<br />
<br />
'ENVIAR<br />
Dim ASCII As Encoding = Encoding.ASCII<br />
Dim envio As String = Me.txtAccion.Text<br />
Dim ByteGet As [Byte]() = ASCII.GetBytes(envio)<br />
Dim RecvBytes(255) As [Byte]<br />
Dim strRetPage As [String] = Nothing<br />
<br />
tmpS.Send(ByteGet, ByteGet.Length, 0)
And in the client pc I have this code:
'CREAR EL SOCKET Y CONECTAR<br />
Dim iphe As IPHostEntry = Nothing<br />
iphe = Dns.Resolve(server)<br />
<br />
Dim ipad As IPAddress = iphe.AddressList(0)<br />
ipad = iphe.AddressList(0)<br />
<br />
Dim ipe As New IPEndPoint(ipad, port)<br />
Dim tmpS As New Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp)<br />
<br />
tmpS.Connect(ipe)<br />
<br />
'******************************************<br />
<br />
'RECIBIR<br />
Dim ASCII As Encoding = Encoding.ASCII<br />
Dim [Get] As String = "GET / HTTP/1.1" + ControlChars.Cr + ControlChars.Lf + "Host: " + server + ControlChars.Cr + ControlChars.Lf + "Connection: Close" + ControlChars.Cr + ControlChars.Lf + ControlChars.Cr + ControlChars.Lf<br />
Dim ByteGet As [Byte]() = ASCII.GetBytes([Get])<br />
Dim RecvBytes(255) As [Byte]<br />
Dim strRetPage As [String] = Nothing<br />
<br />
' Receive the server home page content.<br />
Dim bytes As Int32 = tmpS.Receive(RecvBytes, RecvBytes.Length, 0)<br />
<br />
' Read the first 256 bytes.<br />
strRetPage = strRetPage + ASCII.GetString(RecvBytes, 0, bytes)<br />
<br />
While bytes > 0<br />
bytes = tmpS.Receive(RecvBytes, RecvBytes.Length, 0)<br />
strRetPage = strRetPage + ASCII.GetString(RecvBytes, 0, bytes)<br />
End While<br />
<br />
MessageBox.Show(strRetPage)
Maybe all the code is wrong (sure!). Someone can help me with this?
Maybe there is an easy way to make this... I'm sure someone will teach me
|
|
|
|
|
How to view Vedio Stream in VB6? How to captures stills from it and store?
Shoaib Nawaz
|
|
|
|
|
Hello,
Thanks to an article I found here, I finally have figured out how to put a combobox into my datagrid.
It works great!
I'm still going through it, trying to figure out how it works (and why it works
Now I'm struggling with this:
I populate my datagrid with a SQL command that pulls a table from SQL.
I populate the values in my combobox with a SQL command that pulls several items from a different table.
When I click on my column in the datagrid that triggers the combobox, and select a value from my combobox, then move to another cell in the datagrid, how do I keep my newly selected item?
I'm having trouble wrapping my head around how best to do this...
Thanks in advance!
Amber
|
|
|
|
|
OK, if I understand your problem, you have a DataGrid. When you pick a cell from a certain column, a ComboBox is shown. You select a new value, then move away from the cell. The ComboBox disappears, but the cell now still contains the old value. Is this an accurate description of your problem?
If so, the part you are leaving out is updating the new combobox selection back into the DataGrid's undelying data source for the row just changed.
|
|
|
|
|
Yes, you understand exactly what I'm trying to do.
I'm unclear how to update the datagrid with the new selection...
Thanks!
amber
|
|
|
|
|
I've never actually done this - embed controls in a DataGrid. So someone else can probably give you a better answer. But what I think you need to do is first get the column and Row numbers corresponding to the cell with the combobox. You can do this from the DataGrid.CurrentCell.RowNumber and DataGrid.CurrentCell.ColumnNumber.
Then you translate those numbers into the specific datacolumn and datarow position in the DataSet your Grid uses. I say "translate" because you may not be showing all columns in the DataSet in your grid, etc. Then you update that value in the actual DataSet.
At least I think that works - again, I've never actually added a combobox to a DataGrid.
|
|
|
|
|
hi to all
i want to print content of a MSFlexgrid in visual basic, the content
of this MSFlexgrid is result a query.
i don not khonw can use crystal report for this reason, and if yes, how do this.
please help me.
|
|
|
|
|
Open Field Explorer in Crystal Report 9.
Create a new SQL Expression Field and Assign a Unique name [MySQLQuery] to it.
Use the same Query Here that You used to fill your MSFLAXGRID.
click on [+] besides Your Query name [MySQLQuery], It will expand.
Drad all the fields on to "detail" and then press F5 to refresh.
Shoaib Nawaz
|
|
|
|
|
hi all!
I want to put a form(instead of a List items)in a combobox .
my means is , everytimes , i Press the combobox button , instead of item , a form or any controls (checkbox,radiobutton,etc.) is appeared .
how can i do it?
mostafa hosseiny b.
|
|
|
|
|
AFAIK, you can't. The ComboBox will render strings in it's list, not graphical object. If you wanted to do this, I think you would have to make your own version of the control and write the proper rendering code.
You might get some useful information out of this[^] article here on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks , but about datepicker , how does it to be designed?
mymeans is if it's possible , i can to design like this ...
thanks to guide ...
mostafa hosseiny b.
|
|
|
|
|
The DateTimePicker is a very custom Combobox. Everything about the DTP control overrides the original code of the ComboBox. This is a topic that is much too large for a forum discussion. I would suggest going to Google and searching for articles on "Custom Controls", or "Custom ComboBox" for more information and examples on how you can ownerdraw your own ComboBox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|