|
No problem! It happens to the best of us!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I would appreciate any strategy that would allow me to locate a string within an rtf document and identify what printed page it would be on.
I am trying to programmatically fill in page numbers for a Table Of Contents within the document.
Thank you,
Brad
|
|
|
|
|
That depends on alot of things -
The font used for the text, the dpi of the printing context, the printable area of the printing context, the line height of the text.. there's no straightforward way to do it.
The best way I've found to do it is to actually execute a print on the document and count how many times OnPrintPage is called and the character indices at which the print boundaries get determined.
|
|
|
|
|
Hi! does anyone know the easiest way to send email using :-Dvisual basic 2005 (I searched the web and found many vb .net codings but it does not seem to work), and I don't know what is a localhost that much and if I have to use it can I use yahoo or Google as a localhost?
ps.
pls don't give me links to other web sites because I have already been through a million.
~thanks in advance~
|
|
|
|
|
Did you find the end all site http://www.systemnetmail.com/[^] that answers many many questions and provides examples about doing exactly what you're asking?
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
localhost is a synonym for the local machine. It's IP address is 127.0.0.1
You can use Yahoo or Google as a host, but not localhost (because localhost is local to you)
|
|
|
|
|
You can use the System.Net.Mail class. Works very well.
|
|
|
|
|
How to delete all folder starting with the characters "abc"? All sub folders should be deleted too and the deletion should work even some folders had files in them.
|
|
|
|
|
This is very easily done with the Directory class and it's Delete method.
Directory.Delete(path, True)
The True parameter is necessary to delete everything inside the target directory, all of it's subdirectories and files.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hello,
I'm writing a kind of editor app to design and execute batch processes. I need a control (or similar) that would allow me to display stdout messages on the lower part of the screen, like VisualStudio does when compiling etc. (Where) can I find something like this ?
Hope the question makes sense, I'm just a .net beginner.
Thanks,
Miguel
|
|
|
|
|
A TextBox??
It sounds like the problem you have isn't displaying the messages, but getting them from the Process that you're launching??
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
When a process writes text to its standard output(stdout) stream, that is normally gets displayed in the console window. You can redirect the StandardOutput stream property of the Process class, you can manipulate or even supress the text. To use this you have to set RedirectStandardOutput property of ProcessStartInfo to True.
Here I ll give you some sample code (..)
Dim oProcess as New Process
Dim oProcessStartInfo as New ProcessStartInfo("some executable name")
oProcessStartInfo.UseShellExecute = False
oProcessStartInfo.RedirectStandardOutput = True
oProcess.StartInfo = oProcessStartInfo
oProcess.Start()
Dim oStreamReader As StreamReader = oProcess.StandardOutput
Dim myString As String = oStreamReader.ReadLine() ' Or here you can use ReadToEnd() method
Cheers,
Suresh
|
|
|
|
|
|
If you think my answer is perfect then do vote for my message.
Cheers,
Suresh
|
|
|
|
|
... and where am I supposed to do this ?
|
|
|
|
|
Hello all,
I am running VB.Net 2005 and connecting to a Access 2003 DB. For some reason when I add a record and try to save it I get the following error...
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records....yet when I close the progarm and open it back up the record is save but without data (Primary Key only)...I can then write to the data with no problem.
I have several routines that write to different tables and this problem happens on each of them. I am a newbie to VB so you many need to dummy it down for me. Thanks in advance for any help you can give!! I am totally lost on this one.
|
|
|
|
|
In order to use DataAdpaters, every table involved with the adapter has to have a primary key. This is the biggest newbie mistake.
Without seeing your code that queries and updates the database, it's impossible to tell you what wrong.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hey Dave, thank you for the reply. I am using one adapter per table and I am updating one table at a time (and it does have a primary key). Here is an example of when I am running the update in my code....Pat01Surgery is the name of my table and it is in the dataset AnesDataSet
'Update the record
Try
Me.Validate()
Me.Pat01SurgeryBindingSource.EndEdit()
Me.Pat01SurgeryTableAdapter.Update(Me.AnesDataSet.Pat01Surgery)
Catch ex As Exception
MsgBox("Update of Surgury Table Failed")
End Try
Note that I don't get to the catch exception...I get my error on the End Edit line.
Any ideas?
-- modified at 13:12 Thursday 19th April, 2007
|
|
|
|
|
What about the code that creates the TableAdapters? A bogus SQL SELECT statement could screw this up.
.... Or did you use the designer to create your database code?? <wince> </wince>
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I used the designer, I just drug my tables over to the form one at a time and it created my adapters for me.
|
|
|
|
|
Here's the problem with using the Designer to do your database code. It's increased the level of difficulty in supporting problems like this about 10 fold. This is because the designer just wrote a bunch of code for you that you can't find and don't know anything about, let alone why the code works, or in most cases, DOESN'T work!
There's quite a number of possibilities that may cause this error. See this[^] for a good list of them.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Alright, thanks Dave I will take a look at that page and hopefully it will help me find my problem. Have a great day!
|
|
|
|
|
Ok, I got it. I had to put this in my code after my update line...
OleDbDataAdapter.Fill(mydataset.tablename)
pretty much just needed to refill the dataset. I am doing it for each table that I am updating.
I hope this helps someone else one day.
|
|
|
|
|
I wonder if anyone could help me solve this.
I am using VB.Net 2003 with Crystal Reports 10.
Example.
I have a VB form that has values in the text boxes. At the moment I am able to transfer these values to a Crystal Report via code like below
paramField = New ParameterField
discreteVal = New ParameterDiscreteValue
paramField.ParameterFieldName = txtSomething.text
' Set the first discrete value and pass it to the parameter
discreteVal.Value = param_value
paramField.CurrentValues.Add(discreteVal)
ParamFields.Add(paramField)
etc etc
The question is how you can capture values that are held in the datagrid e.g.
Name Dept Age
Alan Accounts 21
Sue Sales 27
Jim Accounts 35
Linda IT 30
Would it be something similar or is there a specific way of capturing values.
|
|
|
|
|
Are you looking at looping through every row of the datagrid? or get the value when a row/cell is selected?
|
|
|
|