|
hello friends,
i need a help!!
how to call DLL from a VB!
the DLL might be codeed in VC++!
plz give me any referece URL or detail with example
thanks in advance!
Rahul here
|
|
|
|
|
|
who can send me a Student Information Management System in vb 6.0 language ?
(use sql for the date base)
thx for advance!
初学者!Don't try it, just do it!
*Archibald*rever dragon!
|
|
|
|
|
Get real! No one is going to send you a complete system written for you in VB6.
What problems are you having with your implementation? If you let us know that we can help you out.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Probably anyone who has passed the course you're now doing. If you want to be lazy and pass your course while remaining unemployable, www.rentacoder.com is the place to do it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all,
i've been trying to use a module to declare my connection, which im gonna call later on my forms.
here's the code in my module:
Imports System.Data.OleDb
Module mod_con
Public con_db_ssr As OleDbConnection
Sub establish_con()
con_db_ssr = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\i1984\Automation\db_ssr.mdb;")
End Sub
End Module
--------------------------------------------------------------------------
here's the code on how iam calling it on my form(s):
con_db_ssr.Open()
--------------------------------------------------------------------------
and here's the error im gettin:
An unhandled exception of type 'System.NullReferenceException' occurred in esB_SSR.exe
Additional information: Object reference not set to an instance of an object.
can anyone help me on this?
tnx...
-::maximus::-
|
|
|
|
|
VB.net / sql
Consider a table having A - Z fields storing integer values. Therefore each record in this table will have A - Z fields. I need to find the maximum value for each record from the fields A - Z.
Can you plz help me with this.
With Best Regards,
Mayur
|
|
|
|
|
You can use SQL to get the maximum of each field by doing something like this:
SELECT MAX(A) as MaxA, MAX(B) as MaxB, ...
I've never tried it but maybe you can do an inner select that would look something like this:
SELECT MAX( SELECT MAX(A) as MaxA, MAX(B) as MaxB,...)
But if not, you could at least use the first one and then put all the values you get back into a datatable/arraylist and sort them to get the max.
Hope this helps a little.
|
|
|
|
|
Thnx Kschuler. the 1st query will give us the max value for each field. Also, the 2nd query, I am not sure if it works, may give us just one value. wat i neede is the max value of all the fields for each record. right now i am getting each field (every record) in an array, sorting it and getting the highest value from it. see the code below.
myrow = DS.Tables("psrec").Rows(0) '1 record - 24 fields
Dim myIntArray(24) As Integer
For i = 0 To 23
myIntArray(i) = myrow(i)
Next
Array.Sort(myIntArray)
maxunits = myIntArray(24)
wat leaves me stumped is that since the array starts from 0, it should end at 23. However, the maxvalue can be found at myIntArray(24). when i print the array using the code,
For i = 0 To 23
Console.WriteLine(myIntArray(i))
Next
I always get 0 for myIntArray(0) for every record and the actual values are displayed from myIntArray(1). Therefore, one value is missed since the array prints till myIntArray(23). The last value is at myIntArray(24).
Can you explain this to me...
With Best Regards,
Mayur
|
|
|
|
|
Okay. I think I got it now. I tested this out and it seems to work, hopefully it will for you too:
SELECT MAX(A, B, C, D) FROM myTable
This will return the largest value for each record. Then you won't have to worry about doing it in code.
As to why your array code wasn't working. I believe that when you declare your array as myIntArray(24) it doesn't create an array with elements of index 0 through 23. It really creates an array of elements 0 through 24. This means that you are not setting that last one, and perhaps it is defaulting to zero. Which would explain that after you sort it, the 0th element is always zero.
|
|
|
|
|
I have created a window service. It works fine.
The only problem i am facing is that when i try to stop the service then it hangs.
I have to restart the system to stop it.
Also i have created other services the same way but the problem is only with this service.
Can anyone help?
|
|
|
|
|
I've been searching for an answer for days and finally decided to ask for help. I have a VB code module that I use for common functions and procedures. In one of my procedures I process all of the session start functions (it is called in the 1st step of the Page's Load event). One of the operations I want to perform is to programmatically value the properties of the user controls that are loaded into the page. I haven't been able to find a reference that shows how to read and set the properties.
Any help or guidance would be appreciated. Thanks.
Harry
-- modified at 22:26 Monday 5th June, 2006
|
|
|
|
|
I found the answer I needed ... after much trial and error. I also realized that this message might be more appropriately posted into the ASP.NET discussion ... but too late once posted. Here was my solution which I current have working (using VB code ... but also applies to C# ... just some different coding techniques):
(1) I defined a parent class object for each of my control classes. Initially I am working primarily with my user controls ... but the same process applies to other control classes. In the parent class I inherit the control class object. Then I defined an overridable "dummy" method and properties that I want to be consistent in all of my controls.
(2) In the controls involved I inherit the parent class that I created. I also define Overrides properties and methods to match the parents.
(3) I also wrote a class that can be invoked from the page script that loops thru the entire control collection (including all of the roots) for the page to find the specific control that I am looking for. Once found, I do a CType of the parent for the control so it is of the correct type. At this point I can directly invoke the overridable method and set the properties ... which actually are the derived methods and properties of the specific control. This approach allows me to avoid using the Reflect class which in itself adds a lot of overhead on the server execution. This approach allows me to invoke a control's method or set its properties from the LOAD event of the page, before the LOAD event of the control is triggered.
Harry
Here is the code for the class that does the search and invoke:
Imports Microsoft.VisualBasic
Public Class clsIPUBFW_Utils
Private strModID As String = "clsIPUBFW_Utils"
Public Sub PostControlState(ByRef pgObj As Page, ByVal strControlsWithState As String)
Dim strProcID As String = "PostControlState"
On Error GoTo ModErrHandler
' This procedure is invoked during the start of the Page LOAD event
' determines if any controls have indicated during their INIT that they maintain state
' and if so, this procedure checks for the control and then invokes the method of the control
' that updates the controls properties from state at the start of the Page's LOAD event
' strControlsWithState is a string that has bar delimited values. The values are added by
' the control's in their INIT event if they use a state model (PGVIEW or SESSION). The format of the
' value is: statemodel - controltype - pageid { parentid : controlid }
If strControlsWithState <> "" Then
Dim objControlsWithState As Object = Split(strControlsWithState, "|")
Dim intLoop As Integer
Dim strCntlName As String
Dim strCntlType As String
For intLoop = 0 To UBound(objControlsWithState)
strCntlName = fIPUBFW_strControlName(objControlsWithState(intLoop))
strCntlType = fIPUBFW_strControlType(objControlsWithState(intLoop))
Call FindAndInvoke(pgObj, strCntlName, strCntlType)
Next
End If
Exit Sub
ModErrHandler:
Call pIPUBFW_ModuleErrorHandler(Err.Description, Err.Number, strModID, strProcID)
End Sub
Private Sub FindAndInvoke(ByRef pgObj As Page, ByVal strCntlName As String, ByVal strCntlType As String)
Dim strProcID As String = "FindAndInvoke"
On Error GoTo ModErrHandler
Select Case UCase(strCntlType)
Case "USER"
Dim cntlToSet As clsIPUBFW_UserCntl
cntlToSet = CType(GetControl(pgObj, strCntlName), clsIPUBFW_UserCntl)
' clsIPUBFW_UserCntl is the class name of the Parent control class for my User controls
cntlToSet.pPostControlStatesToProperties()
' *** AS MORE CONTROL TYPES ARE ADDED THEY CAN BE DEFINED HERE ***
End Select
Exit Sub
ModErrHandler:
Call pIPUBFW_ModuleErrorHandler(Err.Description, Err.Number, strModID, strProcID)
End Sub
Private Function GetControl(ByRef pgObj As Page, ByVal strCntlName As String) As Control
Dim strProcID As String = "GetControl"
On Error GoTo ModErrHandler
' this routine loops thru the control collection (up to 10 tiers of the family tree) to locate
' the desired control that is assumed to be present in the collection
Dim i1, i2, i3, i4, i5, i6, i7, i8, i9, i10 As Integer
Dim cntlWrk1, cntlWrk2, cntlWrk3, cntlWrk4, cntlWrk5, cntlWrk6, cntlWrk7, cntlWrk8, cntlWrk9, cntlWrk10 As Control
Dim strParentID As String = ""
Dim strControlID As String = ""
Dim intPrt As Integer = InStr(strCntlName, ":")
strParentID = Left(strCntlName, (intPrt - 1))
strControlID = Right(strCntlName, (Len(strCntlName) - intPrt))
GetControl = Nothing
If pgObj.HasControls Then
For i1 = 0 To pgObj.Controls.Count - 1
cntlWrk1 = pgObj.Controls(i1)
If PageControlFound(cntlWrk1, strParentID, strControlID) Then
GetControl = cntlWrk1
Exit Function
End If
If cntlWrk1.HasControls Then
For i2 = 0 To cntlWrk1.Controls.Count - 1
cntlWrk2 = cntlWrk1.Controls(i2)
If PageControlFound(cntlWrk2, strParentID, strControlID) Then
GetControl = cntlWrk2
Exit Function
End If
If cntlWrk2.HasControls Then
For i3 = 0 To cntlWrk2.Controls.Count - 1
cntlWrk3 = cntlWrk2.Controls(i3)
If PageControlFound(cntlWrk3, strParentID, strControlID) Then
GetControl = cntlWrk3
Exit Function
End If
If cntlWrk3.HasControls Then
For i4 = 0 To cntlWrk3.Controls.Count - 1
cntlWrk4 = cntlWrk3.Controls(i4)
If PageControlFound(cntlWrk4, strParentID, strControlID) Then
GetControl = cntlWrk4
Exit Function
End If
If cntlWrk4.HasControls Then
For i5 = 0 To cntlWrk4.Controls.Count - 1
cntlWrk5 = cntlWrk4.Controls(i4)
If PageControlFound(cntlWrk5, strParentID, strControlID) Then
GetControl = cntlWrk5
Exit Function
End If
If cntlWrk5.HasControls Then
For i6 = 0 To cntlWrk5.Controls.Count - 1
cntlWrk6 = cntlWrk5.Controls(i6)
If PageControlFound(cntlWrk6, strParentID, strControlID) Then
GetControl = cntlWrk6
Exit Function
End If
If cntlWrk6.HasControls Then
For i7 = 0 To cntlWrk6.Controls.Count - 1
cntlWrk7 = cntlWrk6.Controls(i7)
If PageControlFound(cntlWrk7, strParentID, strControlID) Then
GetControl = cntlWrk7
Exit Function
End If
If cntlWrk7.HasControls Then
For i8 = 0 To cntlWrk7.Controls.Count - 1
cntlWrk8 = cntlWrk7.Controls(i8)
If PageControlFound(cntlWrk8, strParentID, strControlID) Then
GetControl = cntlWrk8
Exit Function
End If
If cntlWrk8.HasControls Then
For i9 = 0 To cntlWrk8.Controls.Count - 1
cntlWrk9 = cntlWrk8.Controls(i9)
If PageControlFound(cntlWrk9, strParentID, strControlID) Then
GetControl = cntlWrk9
Exit Function
End If
If cntlWrk9.HasControls Then
For i10 = 0 To cntlWrk9.Controls.Count - 1
cntlWrk10 = cntlWrk9.Controls(i10)
If PageControlFound(cntlWrk10, strParentID, strControlID) Then
GetControl = cntlWrk10
Exit Function
End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
End If
Next
End If
Exit Function
ModErrHandler:
Call pIPUBFW_ModuleErrorHandler(Err.Description, Err.Number, strModID, strProcID)
End Function
Private Function PageControlFound(ByRef cntlObj As Control, ByVal strParentID As String, ByVal strCntlID As String) As Boolean
Dim strProcID As String = "PageControlFound"
On Error GoTo ModErrHandler
' this routine checks for an ID match on the parentID and controlID within the page control collection
Dim strColCntlID As String = ""
Dim strColParentID As String = ""
Dim blnOut As Boolean = False
If Not cntlObj Is Nothing Then
strColCntlID = cntlObj.ID
strColParentID = cntlObj.Parent.ID
' check for ID match ... if so execute the control`s post state method
If UCase(strColParentID) = UCase(strParentID) And UCase(strColCntlID) = UCase(strCntlID) Then
blnOut = True
End If
End If
PageControlFound = blnOut
Exit Function
ModErrHandler:
Call pIPUBFW_ModuleErrorHandler(Err.Description, Err.Number, strModID, strProcID)
End Function
End Class
|
|
|
|
|
I am using VB6 and mysql for database, just wanna ask what ADODB property im going to use to know if my program is connected to the database? Please help me
|
|
|
|
|
I am using VB 2003.net
I have a field that I want to have the ability fill in a great about of data, but not take up the whole screen.
On the form I have a small text box "Quote_Note" that Shows 5-6 lines of my typed test. For ease of typing and to see a whole screen when typing. I am opening a new form "Text_Box" that is one large text box called Quote_Note.
Private Sub QUOTE_NOTE_ENTER(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QUOTE_NOTE.Enter
Dim TEXT_BOX As New TEXT_BOX
TEXT_BOX.QUOTE_NOTE.Text = QUOTE_NOTE.Text
TEXT_BOX.Show()
End Sub
Issue 1)How do I get the data back to my calling form Quote.Quote_note.text from TEXT_BOX.Quote_note.text
2) When I tab into Quote.Quote_note.text and it opens TEXT_BOX.Quote_note.text I get a cursor
but if I mouse click on Quote.Quote_note.text I do not? Any Ideas.
|
|
|
|
|
Hi,
I am developing my first applicaiton in .NET.
I have a datagrid in my application,which has editing capability. Using this datagrid, one can insert new row or update existing row.
My question is, only managers should be able to edit this datagrid.i.e, only managers can insert/update data from the table. Rest of the people should be able to see the data in the grid.
can anybody please tell me how canI implement this? I really appreciate your help!!!
|
|
|
|
|
The simple method is that when user clicks the update button it should display UserName and Password Input box, if it matches to Manager's UserName and Password,which u set in you code, it should use the Datatable.acceptchanges method..
otherwise use Datatable.rejectchanges method
Does it works?
|
|
|
|
|
hi guys..
this is Bobby..Can any one help me out how to capture an live image through a webcam in VB6.0.I need your help guys..
Expecting an immediate reply.
Bobby
|
|
|
|
|
In VB.NET i placed PrintControl in Form,then i am trying to show
report in this print control.
I am selecting nearly 30000 students,when executing
objRpt.CreateDocument()
line system is not responding and i am
getting "System.OutOfMemoryException"
But it works well when selecting 1000 records.
Private Sub ShowStudenReport()
Dim objRpt As New XtraRptStudent
Dim dsTest As DataSet
objRpt.DataSource = dsTest
objRpt.DataMember = dsTest.Tables(0).TableName
PrintControl1.PrintingSystem = objRpt.PrintingSystem
objRpt.CreateDocument()
End Sub
when executing line "objRpt.CreateDocument()" ,the system is not
responding...
please provide solution
Thankx.
|
|
|
|
|
Hi
this is the code for searching the value 'Computer' in 'Subject' column in datagrid ....
Dim gridTable As DataTable = CType(DataGrid1.DataSource, DataTable)
gridTable.DefaultView.RowFilter = "Subject = 'computer'"
gridTable.DefaultView.Sort = "Edition"
but now I want that user should put value in Textbox and then it should be filtered and display in datagrid but having problem in Query...
Plz Help me
Thanks
|
|
|
|
|
Does it work to just use this:
gridTable.DefaultView.RowFilter = "Subject = '" & txtMyTextBox.Text.Trim & "'" ??
|
|
|
|
|
Thanks Kschuler
Its really working... I was trying to solve problem but having difficulty in query and You have solved it
Thank You Once Again
Syed Ali Raza Rizvi
|
|
|
|
|
i'm reading the files names from a directory and subdirectory, and i want to bound a progress bar with the time of getting the files from the directory, how?
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
How can i handle something when the the system is idle
for example the screen saver run with the system is idle
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
i want to read a text from word document, how can i read the content without reading the scripts and styles of the word.
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|