|
what are you trying to do is not possible i think so but you can try by database manager property
prem kumar singh
|
|
|
|
|
Thanks for help.
But
Cant we take stored proedure's result into crystal report?
Will u tell me please
How should i Try with database manager property.
-Regards Priya.
"The Difficult i can do it now...
The Impossible will take a little longer."
|
|
|
|
|
I've not used Crystal for many years - but I seem to remember that there was an option for executing a "pass-through" query that would allow you to use native SQL-Server syntax (ie. "EXEC MyStoredProc 'ABC' ").
|
|
|
|
|
I am trying to send an email using my program. How Many ways are ther to do it? Which is the best way, currently i have:
Dim m As New MailMessage(FromtextBox.Text, ToTextBox.Text, SubjectTextBox.Text, BodyTextBox.Text)<br />
Dim a As New Attachment(My.Settings.CurrentList)<br />
Dim c As New SmtpClient<br />
m.Attachments.Add(a)<br />
c.Host = ""<br />
c.Send(m)
My main problem however is that i have no host info, is there anyway to access the host information on the machine the program is running on and, if not, is there an alternative, other than manuel user entry?
Posted by The ANZAC
|
|
|
|
|
If you don't have the host info, you need to use MAPI, there are .NET MAPI wrappers on the web.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You make it sound easy, but i'm new to sending mail and have no idea about MAPI. Is there anyway to programatically extract Host Info or should I just add a user customisable setting to my program.
P.S. What Host Info is actually required to send an email, does it include password etc, or just the server.
Posted by The ANZAC
|
|
|
|
|
I've decided to go with having the user enter the server setting. Then its saved and is used automatically until changed.
Posted by The ANZAC
|
|
|
|
|
<code></code>I want datagrid code in which we r able to enter direct.for eg like in excel sheet we enter means we write in tables .same code want able to write directly in datagrid and then save that data
|
|
|
|
|
You must using dataset and binding it with datagrid
|
|
|
|
|
add ItemTemplates instead of normal columns in datagrid
Nana
|
|
|
|
|
Hello all!
I can't beleive I can't get this, but here it goes. I want to reset a integer number that used for a time. So at the top I have
Public mysec As Integer = 15
Then I have this for my timer
Private Sub tmrGame_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrGame.Tick<br />
Threading.Thread.SpinWait(1000)<br />
mysec = mysec - 1<br />
lblcdClock.Text = ":" & mysec<br />
If mysec > 15 Then<br />
mysec = 0<br />
End If<br />
If mysec = -1 Then<br />
tmrGame.Stop()<br />
lblcdClock.Text = ":" & 0<br />
Threading.Thread.Sleep(2000)<br />
lblcdClock.Text = ":" & 15<br />
End If<br />
End Sub
How can I reset "mysec" to 15 so when the time stops, and I start it agin, it start from 15? Using VS 2003.
Thanks!
Rudy
|
|
|
|
|
The method that starts the timer should reset the variable.
rudemusik wrote: If mysec = -1
if mysec < 0 is a safer check to make, just in case.
So, if it goes over 15, it gets reset to 0, and on the next iteration, it will end ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian!
It's actually counting down from 15. I have mysec = -1 so that a 0 will show. After the 0 shows, I set the label to 15. But it doesn't change my intger, so if it starts again, it will start with -1, -2 and so on. How can I change the 0 to a 15 as if if I were reloading the form to kick off the "Public mysec As Integer = 15" line.
Thanks!
Rudy
|
|
|
|
|
'Resetting' the value is as simple as mysec = 15, you should do this just before you start the countdown.
|
|
|
|
|
Thanks Everybody!
I finally got it. I actually had to put "mysec = 15" at the end of the countdown.
Thanks again!
Rudy
|
|
|
|
|
keep all your code inside inner loop and when the loop will end assign mysec=15
enclose this also inside an outer loop
.use 2 while loop this will be better and give terminating condition in outer while loop
ok
prem kumar singh
|
|
|
|
|
Hi Lucky!
What do you ean by inner loop?
Thanks!
Rudy
|
|
|
|
|
Hi all,
I'm working on the following problem with VB2005: An application (which is not under my control) appends a new line of information to a logfile (*.txt) once per second. A filesystemwatcher raises an event any time the filesize has changed. I have to open the file, read the last line of new information and close the file immediately to allow the next line to be written by 'the other' software.
The problems:
1. The log file is big and becomes bigger every second. So I want to avoid reading the complete file and throw everything away except of the last new line. Has anyone got an idea, how to make a slim 'last-line-reader'?
2. It seems, that the file is not closed after reading immediately, which corresponds to what I find in several books. Any chance to close a file again immediately?
Thanks to all, bodobe
|
|
|
|
|
What are you doing with this information that you would need to save it every second then read it from another watcher program when it changes??
Cleako
|
|
|
|
|
Hi,
'the other software' is the frontend of a measurement system writing measurement data continuously (well, nearly - once per second). It's a closed system with no other access to the measurement data, postprocessing is supposed to be done via Excel. I started writing a 'real time postprocessing' for this application - that's why and what for I have to use this workaround.
Best regards, bodobe
|
|
|
|
|
Does the log file need to exist indefinitely or just until the post processor works with it?
Cleako
|
|
|
|
|
Once I have read the data lines into my software, I can write a new logfile. So the original logfile is no longer required.
BR, bodobe
|
|
|
|
|
You could do that then. Create a new file for each entry. In the post processor always start from the oldest file, read it in, then delete it after closing the file. That way you are never attempting to read a file you are writing to or the other way around.
Cleako
|
|
|
|
|
 I think you can use the a FileStream object to randomly access a file. Here is some code for you to look over. I added a button to the form and when you click the button a messagbox appears displaying the last text to be added to a text file. It keeps track of the last position read so the next time it reads the file it can begin reading it from the last position read. To test it just create a file "c:\test.txt". Run the application and then modify the text file and save it. Clicking the button should display the text you entered. Open the file again and add another line and save it. Again clicking the button should show you the new line of text.
Public Class Form1
Dim index As Long = -1
Const file As String = "c:\test.txt"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'FileInfo object so we can get the file size
Dim info As New IO.FileInfo(file)
'How many new bytes since we last checked
Dim count As Long = info.Length - index
'File hasn't changed so return
If count <= 0 Then Return
'File stream to read file
Dim stream As IO.FileStream = IO.File.Open(file, IO.FileMode.Open, IO.FileAccess.Read)
'Buffer to retrieve bytes
Dim buf(count) As Byte
'Set the streams position to where we last left off
stream.Position = index
'Read the new bytes
stream.Read(buf, 0, count)
'clean-up so we don't get in the way of the other program
stream.Close()
stream.Dispose()
'Decoder to convert byte array to string
Dim textDecoder As New System.Text.ASCIIEncoding
'The new text
Dim str As String = textDecoder.GetString(buf)
'Display new text
MsgBox(str)
'Set index to next position
index = info.Length
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Initialize index to the last position in the file
Dim info As New IO.FileInfo(file)
index = info.Length
End Sub
End Class
|
|
|
|
|
Hi, thanks a lot, works great! I only had to place the IO.File.Open(...) into a Try..Catch, because the FileSystemWatche raises the FileChanged-Event a bit too early: File has been changed, but not yet been closed by the other software.
While LogReadPermission <> True
Try
stream = IO.File.Open(LogFile, FileMode.Open, FileAccess.Read)
LogReadPermission = True 'if stream has been opened without exception, allow reading and leave 'while'
Catch ex As Exception
Threading.Thread.Sleep(5) 'short wait before next try
i += 1
If i > 100 Then
MsgBox("Logfile not found! " & ex.ToString)
End If
End Try
End While
stream.Position = Index
stream.Read(buf, 0, count)
...
|
|
|
|