Change the for statement to say:
For Each f As File In FTPDownload.ListDirectory
Then reference f.
The problem is that you are refrenceing a class File that has not been instantiated.
Change the for statement to say:
For Each f As File In FTPDownload.ListDirectory
Then reference f.
The problem is that you are refrenceing a class File that has not been instantiated.
I took us a good week to iron out all of the problems.
That mde has been phased out though. We replaced it with a .net application 4 months later.
Would something like this work:
FormatNumber(CInt(1000 + 2.6 + 3.5)), 2)
Just let the framework do the formatting for you.
My guess would be this statement:
.Rows.Add(table.Rows(i)("frmStudentReg.regno"), table.Rows(i)("nursery.rollno"), table.Rows(i)("nursery.nepali(writing)"), table.Rows(i)("nursery.nepali(oral)"), table.Rows(i)("nursery.maths(writing1)"), table.Rows(i)("nursery.maths(oral)"), table.Rows(i)("nursery.maths(writing2)"), table.Rows(i)("nursery.english(writing)"), table.Rows(i)("nursery.english(oral)"), table.Rows(i)("nursery.physical_edu(oral)"), table.Rows(i)("nursery.creative(oral)"))
You need to set column values and I don't think the Rows.Add method allows that.
Something like this would work:
With DataGridView1
Dim dgvr As New DataGridViewRow
'add cells/values
DataGridView1.Rows.Add(dgvr)
End With
You could use a ComboBox control with the autocomplete items filled with your names. Then, as the users type into the box, a drop down will appear with the possible names. (Make use of the comobox's SelectedValueChanged event.
For example:
Private Sub FillComboBox(ByVal dt As DataTable)
Try
'Clear the combobox
ComboBox1.Items.Clear()
'Fill the lookup as well
Dim acSC As New AutoCompleteStringCollection
If dt.Rows.Count > 0 Then
For Each dr As DataRow In dt.Rows
ComboBox1.Items.Add(dr("Name")) 'Place the name of the 'NameColumn' from the database inside the quotes.
acSC.Add(dr("Name")) 'Same here
Next
With ComboBox1
.AutoCompleteCustomSource = acSC
.AutoCompleteMode = AutoCompleteMode.SuggestAppend
End With
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
You will need to retreive items from the database and store them in a DataSet/DataTable or read them with a DataReader.
Are you wanting a local version of your data? (For editing and pushing back out to the db)
Or are you wanting the application to read data only?
We had to upgrade from 10.0 to 12.0 when we upgraded. We are doing some basic inserting/deleting from table and running some queries.
As far as provider, is it a connection string problem?
See here.
Have you tried using the Me.Load event instead to see what happens?
There are quite a few issues with 2000 > 2007, but with 2003 we only had a few missing controls some forms in an MDE application.
We lost small stuff like a drop-down calendar and a text box off of another form.
Here is a decent article you can read as well.
The webpage that you see is a click once deployment page giving you a summary of the application and an install button correct?
You can turn the page off in the My Project > Deployement > Options > Deployement dialog.
See if this fixes your problem.
You will need to look at a reporting solution.
Two major solutions exist.
Copy the files to a directory in the solution of your project.
Then include the directory with the publish.
When looking at the solution explorer, add a folder.
Once you have added and named the folder, right click and click add existing item.
Set the filter of the dialog to any file type, navigate to the items, and click them, and press add.
You will have to program on the ComboBox's SelectedIndexChanged event and fire the code then.
You will have to retreive the value from the database and post it to the textbox.
For example:
Private Sub combItems_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles combItems.SelectedIndexChanged
Try
Query = "SELECT itemStock FROM tbl_items WHERE itemName='{0}'"
String.Format(Query,TryCast(sender,ComboBox).SelectedItem.Text)
MySqlCommand = New MySqlCommand(Query, CNN)
MySqlDataReader = MySqlCommand.ExecuteReader
Do While MySqlDataReader.Read
TextBox1.Text = MySqlDataReader(0)
Loop
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
The code:
Dim rowcnt As Integer = (dtOrder.Rows.Count - 1)
For x = 0 To rowcnt
If IsNumeric((dtOrder.Rows(x)(3).ToString)) Then
val = CInt(dtOrder.Rows(x)(3).ToString)
With fractColumn
.ColumnName = "xttl"
.Expression = ((dlgNewTop.Dec2Frac(val, 2)))
End With
End If
Next
With dtOrder.Columns
.Add(fractColumn)
End With
Will only add the last because that is the only row you are telling it to add.
This code is outside the for:
With dtOrder.Columns
.Add(fractColumn)
End With
Therefore, the only value added would be the last value it sees. (The value of the column from the last row of dtOrders)
Try This instead:
For x = 0 to dtOrder.Rows.Count - 1
If IsNumeric((dtOrder.Rows(x)(3).ToString)) Then
val = CInt(dtOrder.Rows(x)(3).ToString)
With fractColumn
.ColumnName = "xttl"
.Expression = ((dlgNewTop.Dec2Frac(val, 2)))
End With
End If
With dtOrder.Columns
.Add(fractColumn)
End With
Next
Your select statement for your datagridview can be edited to order by the column chosen.
For example:
"SELECT * FROM Table ORDER BY Column4 ASC"
Will sort data by column for ascending.
For decending just do the opposite:
"SELECT * FROM Table ORDER BY Column4 DESC"
Change this:
ds.Tables("FamilieNummer")
To This:
ds.Tables("Max")
You are filling a table called "Max" but searching for a table called FamilieNummer.
Remember that the data set is in memory, not in database.
I am sorry to hear about health problems. I hope everything is okay!
Not quite sure what you plan to acheive with that syntax.
If you are trying to format the output, read this.
You are wanting to save a .csv file or a MySQL proprietary file?
I think this statement would be the culprit:
.numberofstudents = Group.Count()
But my LINQ is shoddy at best. :(
One possible problem ( that I've had with CR ) could be that the report was built on a 64bit CR machine, and published. We had to make sure it was a 32bit machine to fix our problem.
It did the same, timed out on pull, but pulled fine in GUI.
The font constructor requires a font size. (Em Size)
What error is the installation giving you?
Something like this might help:
Private Sub WriteToProgressBar(ByVal pbIn As ProgressBar, ByVal sTextToDraw As String, ByVal f As Font, ByVal b As Brush)
Try
Using g As Graphics = Me.CreateGraphics
'Check to see if text is to wide/tall
If sTextToDraw.Length * f.Size > pbIn.Width Or _
f.Height > pbIn.Height Then
Throw New ArgumentException("Text is to large for progress bar!")
Else
Dim iTryGetCenterW As Integer = (pbIn.Width / 2) - ((sTextToDraw.Length * f.Size) / 2)
Dim iTryGetCenterH As Integer = (pbIn.Height / 2) - (f.Size / 2)
g.DrawString(sTextToDraw, f, b, New Point(iTryGetCenterW, iTryGetCenterH))
End If
End Using
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
You will have to take the progress bar's location into consideration as well.
But you must take the progress bar's location into consideration.
I am not so sure about the legitimacy of the email lookup @ pwndlist.
After typing:
a@a.a
b@b.b
c@c.c
All of the address returned N occurrences since July, 2011
All of the address had been compromised 4 months ago.
VB.NET doesnt support transparent labels. You will have to draw the text over it using the Graphics.DrawString or some kind of custom control.
Microsoft decided that we didn't need this function. >(
You can use transparent panels and such, but when you set them to transparent - the label will still have a boarder around your text.
The question would be then, is it a problem with #3?
Have you looked at your SQL statements to see if it is causing the service to time out?
Ie. alot of inner joins,table creations, or any cpu hog procedures?
I have had problems with this using SSRS (SQL Server Reporting Services) and it turns out that it is a process that terminates and must be restarted to pull a report.
The workaround that I had found is here.
The first pull starts the process/freezes , and the second pull is fine correct?
127.0.0.1 is not a valid IP address to communicate over the network.
It is the home address.
You will need the IP address of your host terminal, as pritaeas said.
With the satement of you working on this project at a university brings up a few questions.
Does the univerisity use DNS?
If not is the terminal IP static, or on a 24 hour lease?
If the IP is not static, then you will have to change it every time the machine does not lease the same IP.
The DNS on the other hand, would remain constant (with exceptions)
After a quck google search, I assume that you mean HP Quick Test Professional.
I have found an article saying that integration with vb.net is impossible and you should be using vbscript.
All of this is severely lacking context.
What do you mean by QTP and do you have any code thus far?
If you are only wanting to increase the width (on the left) you will have to reposition the panel on resize to give the user the illusion it is only increasing the width on the left.
For exmaple:
Do While Panel1.Width < 730
Panel1>Width += 1
Panel1.Location = New Point(Panel1.Location.X - 1, Panel1>Location.Y)
Loop
When you say sliding the panel, do you mean in the parent control or the scroll bar of the panel?
You should look at using the ComboBox_SelectedIndexChanged event.
This can be handled like so:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ComboBox1.SelectedIndexChanged
Try
TextBox1.Text = ComboBox1.SelectedValue
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
If the cell is empty the Value property will be null;
Change
IIf(IsNothing(DataGridView2.Rows(i).Cells(3).Value.ToString), String.Empty, DataGridView2.Rows(i).Cells(3).Value.ToString)
To
IIf(IsNothing(DataGridView2.Rows(i).Cells(3)), String.Empty, DataGridView2.Rows(i).Cells(3).Value.ToString)
As for the connection string, you have to place the string inside the constructor of the connection.
As for the snippet you posted, the connection being passed in to the DataAdapter is not the same connection you are declaring.
You should replace MyOleDBConnection with the name of your connection.
For instance:
Dim MyOleDBConnection As New OleDBConnection("ConnectionStringHere")
Stored as in where are you keeping track of these students?
Are you storing them in a table, workbook, or just creating random numbers?
You could pass the values into a DataAdapter instead of using a string based method.
This would safeguard against SQL Injection attacks, and add some cushion for errors.
Private Sub Insert()
Dim da As New OleDBDataAdapter("SELECT * FROM nursery WHERE 1=2", MyOleDBConnection)
Dim ds As New DataSet
Try
da.Fill(ds, "Nursery") 'This will get table structure without data.
If Not IsNothing(ds.Tables("Nursery")) Then
For Each r As DataGridViewRow In DataGridView1.Rows
Dim dr As DataRow = ds.Tables("Nursery").Rows.Add
dr("regno") = IIf(Not IsNothing(r.Cells(1).Value.ToString), DBNull.Value, CInt(r.Cells(1).Value.ToString))
dr("rollno") = IIf(Not IsNothing(r.Cells(2).Value.ToString), DBNull.Value, r.Cells(2).Value.ToString)
dr("nepali") = IIf(Not IsNothing(r.Cells(3).Value.ToString), DBNull.Value, r.Cells(3).Value.ToString)
dr("com_english_w") = IIf(Not IsNothing(r.Cells(4).Value.ToString), DBNull.Value, r.Cells(4).Value.ToString)
dr("com_english_o") = IIf(Not IsNothing(r.Cells(5).Value.ToString), DBNull.Value, r.Cells(5).Value.ToString)
dr("com_math") = IIf(Not IsNothing(r.Cells(6).Value.ToString), DBNull.Value, r.Cells(6).Value.ToString)
dr("social_w") = IIf(Not IsNothing(r.Cells(7).Value.ToString), DBNull.Value, r.Cells(7).Value.ToString)
dr("social_o") = IIf(Not IsNothing(r.Cells(8).Value.ToString), DBNull.Value, r.Cells(8).Value.ToString)
dr("science_w") = IIf(Not IsNothing(r.Cells(9).Value.ToString), DBNull.Value, r.Cells(9).Value.ToString)
dr("science_o") = IIf(Not IsNothing(r.Cells(10).Value.ToString), DBNull.Value, r.Cells(10).Value.ToString)
dr("hpe_w") = IIf(Not IsNothing(r.Cells(11).Value.ToString), DBNull.Value, r.Cells(11).Value.ToString)
dr("hpe_o") = IIf(Not IsNothing(r.Cells(12).Value.ToString), DBNull.Value, r.Cells(12).Value.ToString)
dr("creative") = IIf(Not IsNothing(r.Cells(13).Value.ToString), DBNull.Value, r.Cells(13).Value.ToString)
dr("health") = IIf(Not IsNothing(r.Cells(14).Value.ToString), DBNull.Value, r.Cells(14).Value.ToString)
dr("extra_math") = IIf(Not IsNothing(r.Cells(15).Value.ToString), DBNull.Value, r.Cells(15).Value.ToString)
dr("extra_eng_w") = IIf(Not IsNothing(r.Cells(16).Value.ToString), DBNull.Value, r.Cells(16).Value.ToString)
dr("extra_eng_o") = IIf(Not IsNothing(r.Cells(17).Value.ToString), DBNull.Value, r.Cells(17).Value.ToString)
Next
da.InsertCommand = New OleDbCommandBuilder(da).GetInsertCommand
da.Update(ds)
MsgBox("Insert successful!")
Else
MsgBox("Table not retreived!")
End If
Catch ex As Exception
MsgBox(ex.ToString)
Finally
da = Nothing
ds = Nothing
End Try
End Sub
Are both clients connected to the same database, or are you both working on two different applications?
First off, you never said how you store the student count. We can't see where this is being stored, so we can't fully help you with your desired format.
Second off, the String.Format statement is incorrect, you would be passing in PaperNo 5 and would get:
5 : 5
As an outcome
The String.Format documentation can be found here.
You can try wrapping the columns in IIFs.
For example:
IFF(IsNothing(DataGridView2.Rows(i).Cells(2).Value.ToString) Or DataGridView2.Rows(i).Cells(2).Value.ToString = String.Empty, String.Empty, DataGridView2.Rows(i).Cells(2).Value.ToString)
The IIF qualifies the statement then pulls the value given.
In this example would be the equivilent of:
IF IsNothing(DataGridView2.Rows(i).Cells(2).Value.ToString)) Or DataGridView2.Rows(i).Cells(2).Value.ToString = String.Empty Then
row2 = String.Empty
Else
row2 = DataGridView2.Rows(i).Cells(2).Value.ToString
End If
A true value should be failsafe like String.Empty or 0.
A false value should be the actual column.
Just a note though, if you WANT null values passed to the database use:
row2 = DBNull.Value
You can read more about this function here.
You can check per column basis:
For example:
Dim Found As Boolean
For Each r As DataRow In dt.Rows
Found = False
For i = 0 To dt.Columns.Count
If r(i) = "ThisValue" Then
Found = True
Exit For
End If
Next
If Found Then Exit For
Next
Also, I have posted another solution on your other post.
I think you can access the Application directory using:
My.Computer.FileSystem.SpecialDirectories
Then use the directory you wish.
If you are wanting to work with the current user just simply use:
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
To save alot of coding.
Can you please post the code being used to connect to the database?
Also, you might want to read this article.
The correct syntax would be:
"SELECT SEGDATA.AdminNo, PapersList.PaperNo FROM SEGDATA,PapersList WHERE SEGDATA.ModuleCode = PapersList.Module1"
This will return all of the records that match.
This will be in the format you want.
You can also add the DISTINCT clause for filtering duplicates.
As for the PapersList Table, you could try using one ModuleCode column with MAX length.
Then you could have more than 9 codes per paper number.
For example
|ModuleCodes|
|EG1003;EG1001;EG1201;EG1092|
Then you could parse the field for the value by splitting on ";" or just tell SQL to get the value with the LIKE Clause.