|
C#Coudou wrote: is my approach correct?
i mean connecting other database in an access form.
here is my snippet code: ACCESS FORM
It looks like VB.NET, but I don't see any OleDbCommand's. Are you using the "old" recordsets?
FWIW; I don't see any code where you bind the data to the UI, nor where you re-open the new connection. The best suggestion I can give is to use the OleDb provider to access your database.
Bastard Programmer from Hell
|
|
|
|
|
nope, this is not vb.net, this is MS Access, that is why you cannot see an oledbcommand.yes, I'm using old recordsets.
You can't see open connection because in the Form1 properties, it has recordsource, also in form open.
If i will use oledb connection, how can i add the data's in my continuous form?
This project is an .adp(microsoft access project),which means if you open the myproject.adp, it is already connected to database.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
C#Coudou wrote: nope, this is not vb.net, this is MS Access, that is why you cannot see an oledbcommand.yes, I'm using old recordsets.
My apologies, I assumed VB.NET - that's the name of the forum.
C#Coudou wrote: If i will use oledb connection, how can i add the data's in my continuous form?
I don't think that will work; those reports are built for use within Access itself.
C#Coudou wrote: This project is an .adp(microsoft access project),which means if you open the myproject.adp, it is already connected to database.
Not even sure whether Access allows switching the current connection.
It's been some time ago that I worked in Access, and we didn't "switch" the connection to another database - we decided it was easier to import the data from other databases, and manipulate it in the current connection.
Bastard Programmer from Hell
|
|
|
|
|
hi,
i and updating my data gridview cell pragmatically.data is showing in the cell. but not updating but if i typed same value in that cell it is updating.
my code is
Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection("Data Source=SQG-133;User Id=" & My.Forms.LoginForm.UsernameTextBox.Text & ";Password=" & My.Forms.LoginForm.PasswordTextBox.Text & ";Initial Catalog=" & My.Forms.LoginForm.tb_database.Text & "")
'update statement----
conn = da_inv.SelectCommand.Connection
da_inv.UpdateCommand = New SqlCommand()
da_inv.UpdateCommand.Connection = conn
da_inv.UpdateCommand.CommandText = "UPDATE dbo.dt_finnance_value_adition SET bank_doc_ref_no=@bank_doc_ref_no WHERE fund_id = @fund_id"
With da_inv.UpdateCommand.Parameters
.Add("@fund_id", SqlDbType.Int, 0, "fund_id")
.Add("@bank_doc_ref_no", SqlDbType.NChar, 10, "bank_doc_ref_no")
End With
'update statement end
da_inv.Update(ds_inv, "inv_table")
|
|
|
|
|
The parameters you are adding contain string literals, you should be using the variables, trying to stuff "fund_id" into an .Int parameter is going to cause problems!
.Add("@fund_id", SqlDbType.Int, 0, "fund_id")
.Add("@bank_doc_ref_no", SqlDbType.NChar, 10, "bank_doc_ref_no")
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I tried this code to display the data in dGV on the form, but it display the datat as a inclined,not as it show in the DGV , row after row.
For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
For j = 0 To DataGridView1.ColumnCount - 1
Dim g As Graphics
g = Me.CreateGraphics()
Dim str As String = Me.DataGridView1.Rows(i).Cells(j).Value
Dim y, X As Integer
y += 20
X += 30
g.DrawString(str, New Font("Times New Roman", 12, FontStyle.Regular), Brushes.DarkGreen, X, y)
Next
Next
|
|
|
|
|
Dim y, X As Integer
y += 20
X += 30
What are these values supposed to represent? I think you need to initialise them with something meaningful.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
need to initialise them with something meaningful.
I didn't found any way about how to use them(X,Y)
|
|
|
|
|
Mangore75 wrote: I didn't found any way about how to use them(X,Y)
Then why are you using them, do you understand what they are for?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I used them y=y+1 and x=x+1 as I think that will print row after row and column after column after column, as I know by little information that I have.
by the way I'm not professional in using VB I'm still beginner.
|
|
|
|
|
Yes but you have not initialised them to any starting point before you add the offsets.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
And then:
1. g = Me.CreateGraphics() is an expensive operation; why is it inside nested loops?
2. Graphics is one of those classes that offer a Dispose method; so if you create (or order creation) of an instance, you should dispose of it too.
Taken together, create once, dispose once.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
|
Because you care about the environment, and don't want big, expensive objects lingering around, possibly holding unmanaged resources, huge memory blocks, system resources, whatever. If you created it and it has a Dispose, call it when done with it.
More[^]
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
In VBA for excel I can lift a table from a website using the QueryTables.Add method.
Here is what I use within an existing excel page...
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.Website.com/Subdir", Destination:=Range("$A$1"))
.Name = "TableName"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
As you can see, this polls the website and then looks for the table on that website that I need to connect to.
However, I would like to do the same thing within a VB.Net application.
What method would I need, and are there any pointers you good people could help me out with?
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
You can use the MSHTML library. The web page is a html document - so you can use a CreateDocumentFromURL and then read the returned document as a html tree.
HTH
|
|
|
|
|
Thanks, I knew there had to be a way!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I have a database with two tables Customers an loans. Customer table contain customer details like id, name, address etc. Loans table contain details of loans taken by customers like loan id, customer id, loan amount. I want to generate a report showing all customers and their loan amount regardless whether customers took loans or not. I tried to do this but it shows only customers who took loans. But i want to show all customers. How can i do this
|
|
|
|
|
That depends on the SQL query you used to get the data. Let's see it. Chances are, you're probably not using a LEFT OUTER JOIN to get all the records on the Customer side of the join.
BTW, this has nothing to do with VB.NET...
|
|
|
|
|
Dear all,
Please help to create pdf viewer in VB (only viewer - disable Save, SaveAs, Print options)
thanks
Jackson..
|
|
|
|
|
Please don't repost your question.
|
|
|
|
|
how to del. my repeated question
|
|
|
|
|
There should be a delete option in your post.
|
|
|
|
|
Not if there's a reaction to it - we wouldn't want orphaned reactions.
Bastard Programmer from Hell
|
|
|
|
|
Dear all,
Please help to create pdf viewer in VB (only viewer - disable Save, SaveAs, Print options)
thanks
Jackson..
|
|
|
|