|
I swear, lately, about 80% of the questions that show up can be answered by a single Google.
I especially love the ones that start with "Where can I find...". Hey! Maybe we could add some code behind the forum Submit button to automatically put the posters question into Google and return a search page, without posting the question to CP!
|
|
|
|
|
User wrote: Help me ! Urgent.
Just checked, even this question will return answers related to programming, in fact amazingly many.
SAP support actually already uses the technique your suggesting to filter out all the
User wrote: Help me ! Urgent. Someone stole my Any key!
messages. Except that they make users go through posted articles before they can log a question.
You might actually be on to something.
My advice is free, and you may get what you paid for.
|
|
|
|
|
I was trying the command line arguments to get the path of the selected folder programatically in vb.net.
It is working fine except one thing
if the folder name is like c:\abc def
then i am getting c:\abc
if the folder name is c:\abc
then the output is correct.
in command line argument
i am using
application path %1
eg
c:\abc.exe %1
Please help
|
|
|
|
|
If the path contains spaces then put it in quotes in the command line.
MyApplication "c:\My Path With Spaces\some file.txt"
or, if you are using a batch parameter
MyApplication "%1"
|
|
|
|
|
Thank You Sir.
|
|
|
|
|
Hello friends,
I stored an image from my front end(VB) into SQL database on a datatype image. Then how can I show that image in VB. Please help
While loading it through recordset I get this '????' .
|
|
|
|
|
Actually wat u want
Regards;
Sherin PM
Quadra Software Solutions Pvt. Ltd.
Email:Sherin_pm85@yahoo.com
|
|
|
|
|
This is the sample Code
where 'FileContent' is the field name of Image and it will save the file in C:\ to open File, where document COde is the primary key in table.This Code opens all kind of File.
Dim RstRpt As New ADODB.Recordset
Set RstRpt = "Select FILECONTENT from tablename" _
& " Where DOCUMENTCODE ='" TXTBOX1.TEXT & "',CNN,ADOPENKEYSET)
Set strStream = New ADODB.Stream
strStream.Type = adTypeBinary
strStream.Open
strStream.Write RstRpt.Fields("FILECONTENT").Value
DestinationFile = "C:\" & Trim(TXTBOX1.TEXT )
strStream.SaveToFile (DestinationFile), adSaveCreateOverWrite
'FileCopy SourceFile, DestinationFile
SetAttr DestinationFile, vbNormal
Call ShellExecute(hwnd, "Open", DestinationFile, "", "C:\", 1)
Hopefully i will help u
Ali
|
|
|
|
|
Hi friend,
I was not at site for these days. That's why i cant reply you. So what is this 'ShellExecute' i can't made it. Is there any references to add?
by Dileeeeeeeeeeep.
|
|
|
|
|
Hi'
a file is created but it is not a picture format.
|
|
|
|
|
So, Let's start from Scratch
U have to set the datatype of this fiel is null because there is no way to
insert an image with other data. First u insert the other info in table and leave it null then update this row by sending the image.Remember 'FileContent' is the field name of Image. Data will be store in Binary Form and when u will retrieve it it will need space to store itself to be opened.
Here is the Code to Insert first.
AdoConne.Execute "Insert into DMSDOCCONTENTTRN (DOCUMENTCODE) values ('" _
& Trim(lbl_DocumentCode.Caption) & "')"
'Now send the Image or Any file in Binary Form.It will take some time depends upon the size of file so have patience.
Dim mFIlePath As String
Dim RstRecordset As New ADODB.Recordset
If RstRecordset.state = 1 Then RstRecordset.Close
RstRecordset.CursorLocation = adUseClient
RstRecordset.Open "Select * from DMSDOCCONTENTTRN Where DOCUMENTCODE = '" & (lbl_DocumentCode.Caption) & "'", AdoConne, adOpenDynamic, adLockOptimistic
Dim b
b = RstRecordset.RecordCount
Set strStream = New ADODB.Stream
strStream.Type = adTypeBinary
strStream.Open
strStream.LoadFromFile Trim(lvw_LoadFile.ListItems(Lint_LoopFile).Text)
RstRecordset.Fields("FILECONTENT").Value = strStream.Read
RstRecordset.Update
Now File has been store in Database Completely and First Phase is Completed.
Now u need to download it. So Wait I simplify the Code for U... Wait
|
|
|
|
|
For Downloding...
'Declare on Gen.DECLARATION
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'This line is also declared on Declaration with both,uploading and downloading
Dim strStream As ADODB.Stream
Dim RstRpt As New ADODB.Recordset
Set RstRpt = ModFncRecordSetReturnRst("Select FILECONTENT from DMSDOCCONTENTTRN" _
& " Where DOCUMENTCODE ='" & txtcode.text & "'")
If RstRpt.RecordCount > 0 Then
Set strStream = New ADODB.Stream
strStream.Type = adTypeBinary
strStream.Open
strStream.Write RstRpt.Fields("FILECONTENT").Value
DestinationFile = "C:\" & txtcode.text
strStream.SaveToFile (DestinationFile), adSaveCreateOverWrite
'FileCopy SourceFile, DestinationFile
SetAttr DestinationFile, vbNormal
Call ShellExecute(hwnd, "Open", DestinationFile, "", "C:\", 1)
'it will save it in C:\ and Open it from the C:\ Path
'In case of Any Trouble Ask me.
Take Care.
Bye.
Regards;
Ali
|
|
|
|
|
hi,
i have developed a client-server application in vb.net.
I am using a socket class in this application.
I have written the following code:
Dim wsTCP As New TcpClient
Dim nwStream As NetworkStream
Dim byt_Buffer() As Byte
Dim async_CallBack As AsyncCallback
Dim ipLocal As System.Net.IPAddress = IPAddress.Parse("MyIpaddress")
Dim wsTcpLst As New TcpListener(ipLocal, portno)
wsTcpLst.Start()
If wsTcpLst.Pending = True Then
wsTCP = wsTcpLst.AcceptTcpClient
wsTCP.Connect(ipaddress, portno)
nwStream = wsTCP.GetStream
byt_Buffer = System.Text.ASCIIEncoding.ASCII.GetBytes("hello")
nwStream.BeginWrite(byt_Buffer, 0, byt_Buffer.Length, Nothing, Nothing)
wsTCP .close
endif
I am getting the error:
Only one usage of each socket address (protocol/network address/port)is normally permitted
at line wstcplst.start.
Please help me out at the earliest how this can be resolved.
Thanks in advance.
|
|
|
|
|
Some other application would appear to be already listening on the port you want to use. e.g. If you are listening on port 80 then you'll have to shut down IIS first (because it got there first)
|
|
|
|
|
how it can be done, from client application i am sending data server.
both are listening the same port which is required so that they will be able communication.
so how can i keep the port open at both end to listen.
how iis can be shut down.
Please elaborate.
thanks.
|
|
|
|
|
i think u should change the port name .
|
|
|
|
|
d_smita wrote: both are listening the same port
Then how do you test or use your application when the client and server happen to be the same machine?
You listen on one port and you send on another.
When you use IE to browse the web, IE sends data to port 80 of the server, but it listens on port 3xxx for a reply. Remember for any communications you need two end points - the end point on the client and the end point on the server.
Typically the server will be listening on a static port. This is necessary because clients have to connect with it some how. The client can use a variable port because it has the opportunity to communicate that with the server. It means that the client can also have multiple ports open to the server.
So, your client initiates the communication and opens a socket. The server will respond on that socket.
|
|
|
|
|
It's because you are doing a listen and a connect on the same port. If you have your app setup as a server then you are going to listen and accept and pass the handle off so that the server can listen for more connections. If you app is a client then you are going to connect to the server and start sending and or receiving data.
Look at some the client server tutorials on this site.
Tom Wright
tawright915@gmail.com
|
|
|
|
|
Stop using URGENT! You have been warned at least twice. Either read the guidelines and comply or stop posting.
__________________
Bob is my homeboy.
|
|
|
|
|
Hi all,
Iam reading from an rtf file some data. i have managed to save them in an array textdata seperated by a comma. What is the fastest way to load data from this array to a sql table? kNowing that i might sometimes have multiple rtf files to read from .
|
|
|
|
|
samerh wrote: i have managed to save them in an array textdata seperated by a comma
What? Are you saying that you read a bunch of RTF (Rich Text Format) files and saved the text in an array? Left's see the code that did this.
samerh wrote: What is the fastest way to load data from this array to a sql table?
Keeping it simple, use an SqlCommand with a parameterized SQL INSERT statement and call this command for each element in your array. If I understand what you're trying to do correctly, you don't even need the array. Just read one file and insert it into the database, read the next, insert it, read, insert... See pattern here?
|
|
|
|
|
Iam new to VB.Net 2005 .I want to write a code such that whenever the user double-clicks on Datagridview the corresponding row values should be displayed in the relevant Textboxes.
I have typed as
txtecode.text=datagridview.item(columnindex,rowindex)
txtecode.text=datagridview.item(0,DATAGRIDVIEW.CURRENTROW.INDEX)
But it is showing error
Please give me the Code to display the data
Tahnk you in advance
|
|
|
|
|
hi,
Use this one at double click event of DatagridView
dim i as integer
i=datagridview.SelectedRows.Item(0).Index
' here 0 indicate first row from selected rows and rowno is store in var. i
txtecode.text=datagridview.rows(i).cells(0).tostring
' here i use first column of selected row(mean first row). u specify according to your requirement
Hope this Helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
I have a new blank web page in vb.net (Default.aspx), and I want to call a webpage design to appear in the same blank web page.Sort of a template.
I have the .css design already.Now how do I call it to appear in that vb.net webpage??
Please help
kagiso
|
|
|
|
|