|
I have come across a design issue (programming in vb.net) . It would be helpful if any one share their opinion about this .
I am trying to design a class and I wanted to make sure I am in the right path...
A 'Rate' is an interest rate at a specific maturity (Term on X-axis and Rate on Y-axis) example...5.2% for 15 year loan.
A rate can be a simple rate as simple as 5.6% for 3 years term or it could be a complex rate where it is combination of two or more simple rates. For complex rate or simple rate the attributes, methods or exactly same. No difference absolutely except that for a complex rate we need to add 1 or more simple rates.
I think I am thinking along the lines of creating a generic class (non-abstract) called as 'RATE' class and create an "RateComposer" class (which will know by accessing database wheather it is a simple rate or a complex rate) which will create multiple instances of 'Rate' class and gets the rate for each simple rate and sums it to get the final complex rate.
Pls comment..
thank you
|
|
|
|
|
You might want to think about implementing an ICollection interface with your "RateComposer" class. It will make subsequent operations on the class much easier.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
thank you. I will think about that.
|
|
|
|
|
I certainly appreciate your response to my problem, Mike. However, I'm still left with the same delima. I've been unable to determine which line on the grid I'm attached to. The following code was intended to accomplish that determination but causes an error.
Private Sub dgAttorney_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dgAttorney.SelectedIndexChanged
Dim source As Object
Dim y As System.Web.UI.WebControls.DataGridCommandEventArgs
'Dim X As String
'X = y.CommandName
Session("County") = y.Item.Cells(0).Text
Session("AttNo") = y.Item.Cells(1).Text
Response.Redirect("frmAttyDetail.aspx")
End Sub
I should be able to use the variable 'e' to make this determination, but that gives me an undefined variable error. The above code (when I click on the button) causes:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 116: 'Dim X As String
Line 117: 'X = y.CommandName
Line 118: Session("County") = y.Item.Cells(0).Text
I've tried everything I could think of. Any other ideas?
Thanks in advance, Jim
|
|
|
|
|
Hi Jim. Okay - without a doubt the "Object reference not set to an instance of an object" error is happening because your variable y is never instantiated. You define the variable with the line:
Dim y As System.Web.UI.WebControls.DataGridCommandEventArgs
but y is never set to an actual object.
I'm wondering if you want to use the ItemCommand event (which uses DataGridCommandEventArgs) instead of SelectedIndexChanged... I'm not sure why you would want the SelectedIndexChanged event to do what you described in your original message, but that just may be because I never thought to do it that way. Can you post the full .aspx page?
|
|
|
|
|
Well, I can sure give that a try, Mike. I'm using the defaults created when I double clicked on the button I had created on the form, it created the SelectedIndexChanged event. It's entirely possible I could use the ItemCommand event. That might very well resolve my problem, however....when does that execute?
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.Attorneys1 = New AttorneyMaintenance.Attorneys
CType(Me.Attorneys1, System.ComponentModel.ISupportInitialize).BeginInit()
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT ATCTY, ATTTP, ATMOD, ATCODE, ATNAME, ATALPH, ATADD1, ATADD2, ATCITY, ATSTA" & _
"T, ATZIP1, ATZIP2, ATARCD, ATEXCH, ATPHN, ATFAX1, ATFAX2, ATFAX3, ATFIL FROM ATT" & _
"YMF"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation id=JIMNEW;packet size=4096;user id=sa;password=wolverine;data source=" & _
"SQLServer;persist security info=False;initial catalog=SWCG_Circuit_Import1"
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO ATTYMF(ATCTY, ATTTP, ATMOD, ATCODE, ATNAME, ATALPH, ATADD1, ATADD2, A" & _
"TCITY, ATSTAT, ATZIP1, ATZIP2, ATARCD, ATEXCH, ATPHN, ATFAX1, ATFAX2, ATFAX3, AT" & _
"FIL) VALUES (@ATCTY, @ATTTP, @ATMOD, @ATCODE, @ATNAME, @ATALPH, @ATADD1, @ATADD2" & _
", @ATCITY, @ATSTAT, @ATZIP1, @ATZIP2, @ATARCD, @ATEXCH, @ATPHN, @ATFAX1, @ATFAX2" & _
", @ATFAX3, @ATFIL); SELECT ATCTY, ATTTP, ATMOD, ATCODE, ATNAME, ATALPH, ATADD1, " & _
"ATADD2, ATCITY, ATSTAT, ATZIP1, ATZIP2, ATARCD, ATEXCH, ATPHN, ATFAX1, ATFAX2, A" & _
"TFAX3, ATFIL FROM ATTYMF"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATCTY", System.Data.SqlDbType.VarChar, 2, "ATCTY"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATTTP", System.Data.SqlDbType.VarChar, 1, "ATTTP"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATMOD", System.Data.SqlDbType.VarChar, 1, "ATMOD"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATCODE", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(6, Byte), CType(0, Byte), "ATCODE", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATNAME", System.Data.SqlDbType.VarChar, 40, "ATNAME"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATALPH", System.Data.SqlDbType.VarChar, 20, "ATALPH"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATADD1", System.Data.SqlDbType.VarChar, 30, "ATADD1"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATADD2", System.Data.SqlDbType.VarChar, 30, "ATADD2"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATCITY", System.Data.SqlDbType.VarChar, 15, "ATCITY"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATSTAT", System.Data.SqlDbType.VarChar, 2, "ATSTAT"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATZIP1", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(5, Byte), CType(0, Byte), "ATZIP1", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATZIP2", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(4, Byte), CType(0, Byte), "ATZIP2", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATARCD", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(3, Byte), CType(0, Byte), "ATARCD", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATEXCH", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(3, Byte), CType(0, Byte), "ATEXCH", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATPHN", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(4, Byte), CType(0, Byte), "ATPHN", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATFAX1", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(3, Byte), CType(0, Byte), "ATFAX1", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATFAX2", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(3, Byte), CType(0, Byte), "ATFAX2", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATFAX3", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, False, CType(4, Byte), CType(0, Byte), "ATFAX3", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ATFIL", System.Data.SqlDbType.VarChar, 83, "ATFIL"))
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "ATTYMF", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("ATCTY", "ATCTY"), New System.Data.Common.DataColumnMapping("ATTTP", "ATTTP"), New System.Data.Common.DataColumnMapping("ATMOD", "ATMOD"), New System.Data.Common.DataColumnMapping("ATCODE", "ATCODE"), New System.Data.Common.DataColumnMapping("ATNAME", "ATNAME"), New System.Data.Common.DataColumnMapping("ATALPH", "ATALPH"), New System.Data.Common.DataColumnMapping("ATADD1", "ATADD1"), New System.Data.Common.DataColumnMapping("ATADD2", "ATADD2"), New System.Data.Common.DataColumnMapping("ATCITY", "ATCITY"), New System.Data.Common.DataColumnMapping("ATSTAT", "ATSTAT"), New System.Data.Common.DataColumnMapping("ATZIP1", "ATZIP1"), New System.Data.Common.DataColumnMapping("ATZIP2", "ATZIP2"), New System.Data.Common.DataColumnMapping("ATARCD", "ATARCD"), New System.Data.Common.DataColumnMapping("ATEXCH", "ATEXCH"), New System.Data.Common.DataColumnMapping("ATPHN", "ATPHN"), New System.Data.Common.DataColumnMapping("ATFAX1", "ATFAX1"), New System.Data.Common.DataColumnMapping("ATFAX2", "ATFAX2"), New System.Data.Common.DataColumnMapping("ATFAX3", "ATFAX3"), New System.Data.Common.DataColumnMapping("ATFIL", "ATFIL")})})
'
'Attorneys1
'
Me.Attorneys1.DataSetName = "attorneys1"
Me.Attorneys1.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.Attorneys1, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Protected WithEvents txtAttorney As System.Web.UI.WebControls.TextBox
Protected WithEvents lblAttorneyName As System.Web.UI.WebControls.Label
Protected WithEvents btnAdd As System.Web.UI.WebControls.Button
Protected WithEvents dgAttorney As System.Web.UI.WebControls.DataGrid
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
Protected WithEvents Attorneys1 As AttorneyMaintenance.Attorneys
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Public Sub FillDataSet(ByVal dataset As AttorneyMaintenance.Attorneys)
dataset.EnforceConstraints = False
Me.SqlConnection1.Open()
Me.SqlDataAdapter1.Fill(dataset)
dataset.EnforceConstraints = True
Me.SqlConnection1.Close()
End Sub
Private Sub Showdetailgrid()
If (Me.dgAttorney.SelectedIndex <> -1) Then
Dim attyrows As System.Data.DataView
Dim currentattyrow As System.Data.DataRowView
attyrows = New DataView
attyrows.Table = Me.Attorneys1.Tables("Attorney")
currentattyrow = attyrows(Me.dgAttorney.SelectedIndex)
End If
End Sub
Private Sub dgAttorney_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dgAttorney.SelectedIndexChanged
Dim source As Object
Dim y As New System.Web.UI.WebControls.DataGridCommandEventArgs
'Dim X As String
'X = y.CommandName
Session("County") = y.Item.Cells(0).Text
Session("AttNo") = y.Item.Cells(1).Text
Response.Redirect("frmAttyDetail.aspx")
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Response.Redirect("frmAttyDetail.aspx")
End Sub
'Create a new DataSet to hold the records returned from the call to FillDataSet().
'A temporary dataset is used, because filling the existing DataSet would
'require the databindings to be rebound
Public Sub LoadDataSet()
Dim objdatasettemp As AttorneyMaintenance.Attorneys
objdatasettemp = New AttorneyMaintenance.Attorneys
Me.FillDataSet(objdatasettemp)
Attorneys1.Clear()
Attorneys1.Merge(objdatasettemp)
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim strSql
strSql = "SELECT ATCTY, ATTTP, ATMOD, ATCODE, ATNAME, ATALPH, ATADD1, ATADD2, ATCITY, ATSTAT, ATZIP1, ATZIP2, ATARCD, ATEXCH, ATPHN, ATFAX1, ATFAX2, ATFAX3, ATFIL FROM ATTYMF where (((ATALPH) Like '%" & txtAttorney.Text & "%'))"
SqlDataAdapter1.SelectCommand.CommandText = strSql
Me.LoadDataSet()
Me.dgAttorney.SelectedIndex = -1
Me.dgAttorney.DataBind()
Application("Attorneys") = Me.Attorneys1
End Sub
Private Sub txtAttorney_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAttorney.TextChanged
End Sub
End Class
|
|
|
|
|
Hi,
I'm using MS Access 2000, and I need to a form that consists of dynamic objects (i.e., the objects (text boxes) in the form are dependent upon data, and may need to change)
Example- The form is illustrating the client's current currency positions. I may need more text boxes in the form if its recordsource increases that types of currency the client possesses. Thus, it the client decides to increase the types of currency's he/she trades, I need the form to dynamically create a new field illustrating that currency.
Using VBA, is there a way to programmatically create a form, so it can store dynamic objects/content?
Please let me know if I have not explained this in great enough detail
I'd appreciate any help at all,
Thanks
Nick
|
|
|
|
|
|
How about
Dim txt as textbox
MyForm.Controls.Add(txt)
The warlord
|
|
|
|
|
How do you load a file from a List box to a text box.
I'm using Microsoft Direct Text-to-Speech and it wont speak from the list box but it will from the text box.
The file is loaded to the list box from the C drive.
So how is this possible???
|
|
|
|
|
You Have To Use The Rich Text Box Instead Of A Textbox So That You Can Easily Load A Text Fine Into It.
Richtexbox1.filename = "PATH"
I You Thinh You Can - "You Can"
|
|
|
|
|
Hello,
I'm building a little VB.NET application who will connect to an Access DB to fill its fields.
I would like to know two things to build my architecture in the right path.
1- Is it a good idea to store the databse location in a registry key (Microsoft.Win32.Registry.CurrentUser)? If not, where should I store it?
2- To access tables in the database, I plan to create, lets say, an SQLAgent class (a layer) between my application and the DB to do any transactions (SELECT, UPDATE, DELETE, ...). This SQLAgent could run any SQL qwery passed in parameter.
The constructor of this SQLAgent class would receive the DB location string to open the DB. Then this SQLAgent object, once created, would receive the SQL qwery to run and return the current recordset.
When this transaction is done, this SQLAgent object can be deleted (finalized). And the VB form can fill its fields with the content of the recordset.
So every forms would have control over its own SQL string and call SQLAgent whenever it need it.
My point is, am I right with #1 and #2?
Thank you very much, I am used with OO but it is the first time I plan to access to DB and I want to do it the right way. Because this is a personal project but I want my code to be reusable, so best practice is the best.
Xelk
|
|
|
|
|
Hi Xelk:
VB.NET facilitates .EXE.COnfig. Is'nt it? You can have the connectionstrings with ScringScrambling or some small-scale reversible encryption and store it there.
What do you say?
Deepak Kumar Vasudevan
Personal Web: http://deepak.portland.co.uk/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Very good idea Deepak,
Is this file editable when the package is compiled then deployed?
What do you think of my point #2?
Thank you
Xelk
|
|
|
|
|
Hi Xelk:
The .EXE.Config file is a kind of plain XML file. You can read it via ConfigurationSettings.AppSettings["keyname"] in your application.
Whatever is there in the Config File for the particular keyname after modifying it, post package and deployment also, would be taken.
Did this attend to your query?
Deepak Kumar Vasudevan
Personal Web: http://www24.brinkster.com/lavanyadeepak/default.asp
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Hello Deepak,
Thank you for your help. I will use this .EXE.Config file. It will be very useful.
Heave a nice day.
Xelk
|
|
|
|
|
hello
i have written this application to capture video and to save the picture
into database.its working fine ... but when i try to close my application
its NOT CLOSING PERFECTLY . some times it hangs.
here is my code ....
(note : here i might have missed some code and variable ... but the application is running ...)
' in the main form module
Private Sub Form_Load()
Dim lpszName As String * 100
Dim lpszVer As String * 100
Dim Caps As CAPDRIVERCAPS ' CAPDRIVERCAPS declared in a
module
' Capture Window creation
' driver info
capGetDriverDescriptionA 0, lpszName, 100, lpszVer, 100
mywdc = capCreateCaptureWindowA(lpszName, WS_CAPTION Or WS_THICKFRAME
Or WS_VISIBLE Or WS_CHILD, 0, 0, 160, 120, Me.hwnd, 0)
' Setting the title of window
SetWindowText mywdc, lpszName
' Setting the video callback function
capSetCallbackOnStatus mywdc, AddressOf MyStatusCallback
capSetCallbackOnError mywdc, AddressOf MyErrorCallback
' Connect to the driver
If capDriverConnect(mywdc, 0) Then
' getting the capture driver capabilities
capDriverGetCaps mywdc, VarPtr(Caps), Len(Caps)
' Start previewing the image
capPreview mywdc, True
' resizing the widow to the whole image
ResizeCaptureWindow mywdc
End If
End Sub
private sub EndAppln
' code to end the application - called in form's queryunlocad and when close menu is selected in main form
'the below given are functions declared a module and called from the main form
capSetCallbackOnError = SendMessage(lwnd,CAP_SET_CALLBACK_ERROR,0,lpProc)
capSetCallbackOnStatus = SendMessage( lwnd,CAP_SET_CALLBACK_STATUS,0,lpProc)
capSetCallbackOnYield = SendMessage(lwnd,CAP_SET_CALLBACK_YIELD,
0,lpProc)
capSetCallbackOnFrame = SendMessage(lwnd,CAP_SET_CALLBACK_FRAME,0,lpProc)
capSetCallbackOnVideoStream = SendMessage(lwnd,CAP_SET_CALLBACK_VIDEOSTREAM, 0,lpProc)
capSetCallbackOnWaveStream = SendMessage(lwnd,CAP_SET_CALLBACK_WAVESTREAM, 0,lpProc)
capSetCallbackOnCapControl = SendMessage(lwnd,CAP_SET_CALLBACK_CAPCONTROL, 0,lpProc)
capCaptureStop (mywdc)
capDriverDisconnect (mywdc)
DestroyWindow (mywdc) ' here the API declared in the module,
called
UnLoad Me
End
End Sub
any one please suggest any changes to be made to my application
TO SAFELY CLOSE MY APPLICATION AND PLESE SUGGEST HOW TO OPTIMIZE MY APPLICATION (AS IT TAKES MUCH MEMORY AND PROCESOR TIME) TO MAKE SURE THE APPLICATION RUN SMOOTHLY ... doh:
Thanks in advance:
Mohan G
|
|
|
|
|
I am working on a project in my company and as I mentioned in the subject of this question, being new to OOPS and new to vb.net, should I consider to adopt or use design pattern in this project ? Or am I better off in terms of meeting deadline to just go-ahead with programming in vb.net (will be using most of OOPS concepts) ?
|
|
|
|
|
It all depends on what your comfortable with, what level your skills are at, of course the size and scope of the project, and what your deadline is. The only person who can answer your question is YOU!
RageInTheMachine9532
|
|
|
|
|
VB HELP!!
does anybody know how to compare between images in pixel....i mean calculate 2 images...(png,gif,jpg)....but need mean square error (MSE),
the formula is MSE= 1/w*h(I'(x,y)-I(x,y))
w=width(image)
h=height
I'=imagepixels1 on posisition coordinat (x,y)
I=imagepixels2 on posisition coordinat (x,y)
there is will be in format(#.######)??
pls help me!!!
====================^_^
|
|
|
|
|
HI,
I WANT TO CONNECT ACCESS DATABASE IN VB.NET. I USED OLEDBCONNECTION.
MY CODE IS
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim connectString As String
Dim myOleConnection as New OleDbConnection
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=D:\DRDA\Database\drda.mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
myOleConnection.ConnectionString = connectString
myOleConnection.Open()
==============ERROR===============
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Additional information: No error information available: DB_SEC_E_AUTH_FAILED(0x80040E4D).
================
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
PLS CAN U PROVIDE ME THE RIGHT CONNECTION STRING.
THANKS
Tasnim
|
|
|
|
|
Public Db as new connection
Add all the required reference
Sub Main()
Set Db = New Connection
Db.CursorLocation = adUseClient
'Access= '
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DbName.mdb;Persist Security Info=False"
Sql server=
Db.Open "Provider=SQLOLEDB.1;Password=" & Password & ";Persist Security Info=True;User ID=" & Username & ";Initial Catalog= " & DataBaseName & " ;Data Source=" & ServerName & ""
End Sub
|
|
|
|
|
Hello everyone, I'm writing an application to intercept web requests done by Internet Explorer and NETSCAPE and then get the url and do some processing. I found some sample code on how to do that with Internet Explorer and its working fine..
Sample Code: http://www.freevbcode.com/ShowCode.Asp?ID=1606
but I need a way to do that in Netscape..
Please help me I've been searching for this for 2 weeks and havn't found a way.
Thank you,
Iyad Marzouka ::- z e r o n e s . n e t -::
|
|
|
|
|
Your going to have to write new classes for Netscape that do the exact same thing the IE sample does. Problem is your going to need the documentation from Netscape's site on the COM class that Navigator exports in order to match up classes, methods, and events to duplicate IE's functionality. Then you can rewrite the sample's class for a Netscape version, that is, IF Netscape exports everything you need...
RageInTheMachine9532
|
|
|
|
|
I am writing a custom control that inherits from the combo box. I like to hide the DropDownStyle property from the user. I have learned from MS Help and many posted threads to shadow the property with <Browsable(False), EditorBrowsable(EditorBrowsableState.Never)>, it hides the property from the property page, but it didn't hide from Intellisense. I must do something wrong, would be glad if anyone can give a suggestion.
Here is the code:
<Browsable(False), EditorBrowsableAttribute(EditorBrowsableState.Never), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
Public Shadows Property DropDownStyle() As System.Windows.Forms.ComboBoxStyle
Get
End Get
Set(ByVal Value As ComboBoxStyle)
End Set
End Property
BTW, I am using Framework 1.0. Many thanks,
Tao
|
|
|
|
|