|
Hi Shameel,
I have these two lines right at the beginning of the class:
Private Delegate Sub AsyncDelegate(ByVal value As Integer, ByVal labelText As String)
Private ProgressUpdater As New AsyncDelegate(AddressOf UpdateProgress) Would that be sufficient?
|
|
|
|
|
Michael Schäuble wrote: Would that be sufficient?
Should be.
Can you check which element of your code is throwing the null reference exception? If your StatusStrip is itself null, then your designer generated code might be screwed up.
|
|
|
|
|
But in that case the If-clause would throw the exception, wouldn't it?
|
|
|
|
|
Michael Schäuble wrote:
But in that case the If-clause would throw the
exception, wouldn't it?
Yes, it usually would. But it is also possible that the Invoked method is throwing the error and since it does not have a Try Catch block, it is being pushed backed up the stack. Add Try Catch and some custom logging to find out where the problem exactly is.
|
|
|
|
|
Thank's for your help, Shameel. I found it out and put the answer into the main message as an edit.
Merry Christmas again!
|
|
|
|
|
You're welcome. As I have mentioned in my other post, since there is no Try Catch block, the exception is pushed up the stack and is handled by the called method at the Invoke call.
|
|
|
|
|
How to create a Table in a VB6 application. Ihave the following code
Private Sub createDB(dbname As String)
Dim db As Database
Dim td As TableDef
Dim fld As Field
Set db = DBEngine(0).CreateDatabase(dbname, dbLangGeneral)
Set td = db.CreateTableDef("Students_Info")
With td
Set fld = .CreateField("Rollno", dbNumber, 3)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("FirstName", dbText, 15)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("LastName", dbText, 15)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("DOB", dbDate)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("Class", dbText, 6)
.Fields.Append fld
Set fld = .CreateField("Subjects", dbText, 6)
.Fields.Append fld
Set fld = .CreateField("Mobile", dbLong, 10)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("Father's_name", dbText, 30)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("Mother's_Name", dbText, 30)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("Address", dbText, 60)
fld.AllowZeroLength = False
fld.Required = True
.Fields.Append fld
Set fld = .CreateField("E_Mail", dbText, 30)
.Fields.Append fld
End With
db.TableDefs.Append td
End Sub
Please Help
Needed for my project
Gopal_Krishan
|
|
|
|
|
You already posted this question in Quick Answers.
It's considered a bad habit to post in more than one forum, mainly because readers can't see what answers already have been given (in the other forum).
Please don't do this again.
Cheers
If you can read this, you don't have Papyrus installed
|
|
|
|
|
Always wrap your code in "pre" tag before posting it.
|
|
|
|
|
i whant the program that excute data incryption standard des
|
|
|
|
|
You have a number of options:
- Search the articles here[^] on CodeProject
- Search Google/Bing/Yahoo
- Write it yourself
- Pay someone to write it for you
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I want a Porsche. Am willing to trade for Google access.
|
|
|
|
|
|
How to use map of a particular state that is downloaded from the google maps in our vb6 application and on that pc there is no internet connection.Have anyone done this before.Please help.
|
|
|
|
|
|
You can't use Google Maps without an internet connection.
|
|
|
|
|
Preeti1979 wrote: Please help.
This is going to hurt, but it's for your own good.
First off all, VB6 is deprecated. It's no longer supperted by Microsoft. It's kicked the bucket, it's shuffled off it's mortal coil, run down the curtain and joined the bleedin' choir invisibile!!
You can use the Microsoft Interop Forms Toolkit[^] to migrate at your own pace. You can extend VB6 applications using .NET code (means you can write new code in .NET and call it from VB6), giving you access to all kinds of .NET goodies like the WebBrowser component, the PropertyGrid control and the EntLib.
Second, you'll need to use something else than a SaaS provider, as they always require internet-access.
Third, you specified what technologies you're interested in, not what you are trying to achieve. You get more usefull replies if you state what you're trying to achieve. Like, if you're looking for longitude and latitude for a specific country, we could advise an alternative like GeoNames[^].
I bet you need maps in a local database.
Bastard Programmer from Hell
|
|
|
|
|
Hi. I am fairly new to VB. I am familiar with reading and writing to a flatfile database in VB and binding it with a datagrid but I have the following problem. I have googled it but couldnt find anything useful. It is a web application.
This was a technical test I had to complete at home in a 2 hour timeframe, for a job application. The 2 hours were from this morning and I already emailed back my attempt. However, I'm still trying to complete the task so that I can learn for future reference as I'm sure I'll encounter relational databases again.
The following are the two tables and their fields:
EMPLOYEE: Payroll (pri key), firstname, surname, department
DEPARTMENT: number (pri key), departmentname, manager
In the EMPLOYEE table, the department is the foreign key to the number in the DEPARTMENT table.
In the DEPARTMENT table, the manager is the foreign key to the payroll in the EMPLOYEE TABLE.
---------------------------------------------
On my form, I have a drop down list which displays the departmentnames from the DEPARTMENT table (these are retail, warehouse and management).
I also have a button and a gridview. When the button is clicked, the gridview should display records from the EMPLOYEE. It should only show the employees who work in the department that was selected in the datagrid. I have the following code at the start of the class:
Dim con As SqlConnection
Dim dsDept As New DataSet
Dim dsEmployee As New DataSet
Dim daDept As SqlClient.SqlDataAdapter
Dim daEmployee As SqlClient.SqlDataAdapter
Dim sqlDept As String
Dim sqlEmployee As String
And I have this code on my button:
con = New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CivicaDB.mdf;Integrated Security=True;User Instance=True")
con.Open()
sqlDept = "SELECT * FROM Department"
daDept = New SqlClient.SqlDataAdapter(sqlDept, con)
daDept.Fill(dsDept, "Department")
con.Close()
Dim currentRow As Integer
currentRow = 0
Dim cmd As New SqlCommand
For Each DataRow In dsDept.Tables("Department").Rows
If dsDept.Tables("Department").Rows(currentRow).Item("Name") = DropDownList1.SelectedValue Then
Dim correctDept As Integer
correctDept = dsDept.Tables("Department").Rows(currentRow).Item("Number")
con.Open()
sqlEmployee = "SELECT * FROM Employee WHERE Department =" & Convert.ToString(correctDept) & ";"
daEmployee = New SqlClient.SqlDataAdapter(sqlEmployee, con)
daEmployee.Fill(dsEmployee, "Employee")
GridView1.DataSource = dsEmployee
GridView1.DataBind()
con.Close()
End If
currentRow = currentRow + 1
Next
Thanks for any help given
|
|
|
|
|
well, if you use VB.NET 2010, then this is the example code to fill binded datagrid.
Private StaffAdapter As New Objects.DataAdapters.StaffAdapter()
Private Sub Staff_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Me.LoadData()
End Sub
Public Sub LoadData()
Me.LoadData(0)
End Sub
Public Sub LoadData(ByVal Id As Long)
Me.DataSet.Staff.Rows.Clear()
Me.StaffAdapter.FillStaff(Me.DataSet.Staff)
If ID <> 0 Then
Me.StaffBindingSource.Position = Me.StaffBindingSource.Find("IdStaff", Id)
End If
End Sub
and this one is my class
Public Sub FillStaff(ByVal Table As DataTable)
Dim cnn As New SqlConnection([Global].Variables.Config.Connection.String)
Dim cmd As SqlCommand = cnn.CreateCommand()
cnn.Open()
cmd.CommandText = "select * from Staff"
Table.Load(cmd.ExecuteReader())
If cnn IsNot Nothing Then
cnn.Dispose()
End If
If cmd IsNot Nothing Then
cmd.Dispose()
End If
End Sub
modified 21-Dec-11 21:37pm.
|
|
|
|
|
Dear brothers please send me the source code to control a scanner
to my email
matrixcombination@gmail.com
please, i really need it for the final assignment
|
|
|
|
|
Muhammad Riadi wrote: final assignment
You want someone to give you code to turn in as your own work?? That's not going to happen.
I suggest you start Googling to solve your problem since you didn't bother to tell use what part of this you're having a problem with.
|
|
|
|
|
Muhammad Riadi wrote: Dear brothers please send me the source code to control a scanner
to my email
matrixcombination@gmail.com
please, i really need it for the final assignment
Wow, trying to cheat under your real name? How stupid is that? You know, that your teachers/tutors might be reading this? And they will put two and two together.
By the way, enjoy the waves of spam that will fill your inbox now.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
modified 21-Dec-11 8:30am.
|
|
|
|
|
I have a problem in make a VB program using DataGrid control..
What i wanna do is delete record from DataGrid and effect database i made,i use Access as database..
thank you for attention..
|
|
|
|
|
There are examples of this all over the web. Just Google for "VB.NET OledbCommandBuilder delete".
|
|
|
|
|