|
hmm, should be able to get something running I would think, I suppose I could just use clickonce for the purpose of the program, it'll work well enough, just means I'll have to rebuild all my datasources, as I'm not a fan of having MDF files in a roaming profile, heh, suppose if I'd set up the SQL properly at the start it'd actually work better as click once...
|
|
|
|
|
kubben wrote: Just because they weren't ment to build production apps, doesn't mean it isn't happening.
If you use the tool for something that's it's not intended for, is that the tool manufacturers fault?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
True, I guess their logic doesn't match my logic in this issue. I guess I tend to try and look at the big picture and do what will help people out in the long run. But I am not so sure that is Microsoft's objective. I am pretty sure they are in the business of making money anyway they can, but that is in part why they are so successful.
Ben
|
|
|
|
|
THe error message is:
"Index and length must refer to a location within the string.
Parameter name: length"
Source: mscorlib
The lines causing the error are:
Dim row() As String = {rowBuild(0), rowBuild(1), rowBuild(2), rowBuild(3), rowBuild(4), rowBuild(5), rowBuild(6), rowBuild(7), rowBuild(8), rowBuild(9), rowBuild(10), rowBuild(11), rowBuild(12), rowBuild(13), rowBuild(14), rowBuild(15)}
Me.dgvData.Rows.Add(row)
This is loading data into an unbound DataGridView. The declaration for rowBuild is
Dim rowBuild(15) As String
Each rowBuild element has data in it, so I can't see what is wrong.
Any ideas????????
David Loring
!! Keep Music Live !!
|
|
|
|
|
Using the code you've supplied, I can't duplicate the problem. I actually can't BREAK it in any way unless I fail to define the columns in the DGV before I add the rows.
With DGV1.Columns
.Clear()
.Add("Col1", "Column Header 1")
.Add("Col2", "Column Header 2")
.Add("Col3", "Column Header 3")
End With
Dim row() As String = {"Data 1", "Data 2", "Data 3"}
DGV1.Rows.Add(row)
Works perfectly. If you don't create the columns first, it'll bomb out with an InvalidOperationException - "No row can be added to a DataGridView control that does not have columns. Columns must be added first."
I'm using .NET 2.0... There's got to be something else about the DGV setup or about the data that we haven't seen.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi Dave, I don't have a problem with the column headers, but just so you can see, the columns are created thus:
dgvData.Columns.Clear()<br />
dStartDay = mv_dCurrentAnomDate.AddDays(-2)<br />
iStartDayNumber = Weekday(dStartDay)<br />
dgvData.Columns.Add("Unit", "UNIT")<br />
For iLoopVar = 1 To 15<br />
dgvData.Columns.Add("D" & Format(iLoopVar, "00"), Format(dStartDay, "dd-mm-yyyy") & Chr(10) & Format(dStartDay, "ddd"))<br />
dgvData.Columns(iLoopVar).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter<br />
dStartDay = dStartDay.AddDays(1)<br />
Next<br />
dgvData.ColumnHeadersHeight = 45
THe only error message I get is this "Index and length must refer to a location within the string.
Parameter name: length"
Source: mscorlib
To be honest I don't actually understand what the error message is trying to tell me!
David Loring
!! Keep Music Live !!
|
|
|
|
|
Hi Dave,
My face is seriously and completely covered in egg!! I apologise for wasting your time as it transpires that the error is actually occuring in the Cell_Enter event and I never saw this because I was stepping over the .add(row)
A sad case of not being able to see the wood for the trees! Too many late nights, cigarettes and much too much coffee.
Thanks again and apologies again.
David Loring
!! Keep Music Live !!
|
|
|
|
|
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
|
|
|
|