|
First, this is a bad way to do this.
Second, the DataAdapter is looking at the status of each row in each table in your source dataset that you pass in and not seeing rows that are tagged changed, added, or deleted. So, yes, the DA is doing nothing, because it hasn't found anything to do! It doesn't know that these rows need to be added to the Access database, because it doesn't know anything about the Access database. It's looking solely at the rows you passed in the dataset.
I would recommend reading up on the documentation for any of the DataAdapters to understand HOW and WHY they work the way they do.
|
|
|
|
|
Thanks for getting back to me. I'm get started learning more about dataadapters. As for your first statement, could you recommend another way of doing this?
Thanks again
|
|
|
|
|
Try using the insert command instead update... you need to creat the some odd thousands of records not update 0
|
|
|
|
|
Hello,
I have a question that...the more i try and research online the more confused I get.
What is the difference between typed and untyped datasets.
What I understand is that typed datasets inherit schema information and untyped dont. It seems like there has to be more to it then that.
Erica
|
|
|
|
|
|
I want to make a 'wall' (picturebox) that the cursor cannot pass through.
This snippet that does NOT work. This is about all i got so far. Mouseposition is a read only so this code can't work.
If Me.MousePosition.X > Me.rightwall.Left Then
Me.MousePosition.X = Me.rightwall
End If
|
|
|
|
|
Me.MousePosition is a Point, and Points are immutable, you can't change them, but you
can replace them by a new Point.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hey guys,
I am trying to create a simple program that will graph a polynomial function.
I have followed a tutorial at about.com, and I ran into a problem while programming. Here is the program so far. I left out the designer generated code. There are two textboxes where the user inputs coefficients for the polynomial, a button that the user presses to draw the graph, and a panel where the graph is drawn. I get an error underlining the New Point under the Button1 Click event that says:
Value of type System.Drawing.Point cannot be converted to System.Drawing.PointF
===========================================================================
Imports System.Drawing.Drawing2D
Imports System.Math
Public Class Form5
Inherits System.Windows.Forms.Form
Dim PolyPoints(100) As PointF
Dim Counter As Integer
Dim P As Pen = New Pen(Color.Crimson, 3)
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
e.Graphics.DrawCurve(P, PolyPoints)
MyBase.OnPaint(e)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim G As Integer
Dim H As Integer
G = TextBox1.Text
H = TextBox1.Text
For Counter = 0 To 99
PolyPoints(Counter) = New Point(Counter, G * ((Counter) ^ 2) + H * ((Counter) ^ 3))
Next
Panel1.Refresh()
End Sub
End Class
============================================================================
I am a novice programmer, and this seems to be a very simple problem. Thanks for your help in advance
Sincerely,
B.T.
|
|
|
|
|
Hi Billy,
you declared PolyPoints as an array of PointF objects (not sure why tho),
so you should only try to move PointF objects in there.
Why not use new PointF(...) ?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I declared it as an array so that I could have a series of a hundred points connected by the DrawCurve. Is there an easier way to do this?
When I replace new Point(...) with new PointF(...), I get a similar problem message.
Value of type 'System.Drawing.PointF' cannot be converted into '1-dimensional array of System.Drawing.PointF'.
I'm not sure what dimension why PointF isn't considered 1-dimensional. Please advise.
Thanks for replying Luc.
B.T.
|
|
|
|
|
Hi Billy,
1.
this does not make sense; the error message "Value of type 'System.Drawing.PointF' cannot be converted into '1-dimensional array ..."
would fit the statement PolyPoints = New PointF(Counter, G * ((Counter) ^ 2) + H * ((Counter) ^ 3))
but yours has/had the index (Counter)
2.
there is another error too, you can't take a textbox text and store it in an integer like
that. You would need something like G = Convert.ToInt32(TextBox1.Text) .
3.
Furthermore if an invalid number is entered (empty, letters, whatever), the code would
throw an error; either provide a try catch construct, or use Int.TryParse or so.
4.
I reckon you want two distinct textboxes for G and H?
5.
You probably want to use floating-point numbers for G and H (and Float.TryParse),
otherwise there is no sense in using PointF and your graphics will not fit your panel...
-- typo corrected at 20:04 Monday 19th November, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi Everyone:
I'm trying to teach myself VB 2005 .NET and the best way I have found to learn something is to make a project in the language I wish to learn.
I'm playing with a graphics Windows application. I want to draw a simple graphics shape(rectangle, circle, line, etc) on a windows form and be able to move that graphics object anywhere on the form using the mouse.
Does anyone have any sample code that can draw a shape on the windows form and allow to move it with the mouse, or arrow keys?
Thanks in advance,
Quecumber256
|
|
|
|
|
If you want to learn, you would be better off writing the code yourself. How are you going to learn anything if someone else writes the code for you?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
There are no built-in classes to do this, not is there any support built into GDI for this either.
What you're referring to is a "retained mode" graphics system. This is something that you either have to write yourself (WARNING! NOT for someone who has little experience!), or use a third party library to handle it for you, like VG.NET.
|
|
|
|
|
Dave:
Thank you. I have had some discussions with our .NET developer here at the office and he put some things in perspective for me.
For example: I drew a square on the windows form. That would be level 1. Next I drew a circle on top of the square, this is level 2. So if I click on the circle I have to have some routine that looks at the levels and sees where the cursor is pointing, which level it is on, and then place some kind of "visual handlers" around the object then use another routine to move it on the form.
This helps me grasp the concept of what I'm trying to accomplish.
Do you have any recommendations for books that cover graphics manipulation and programming for VB .NET?
Thank you,
Quecumber256
|
|
|
|
|
Hi! Please help me in finding a component which can be used to generate a pdf file or even a tiff file from a template of these formats so that I can replace existing place holders in the template with the values. I'm using Visual basic 6 for this purpose.
Any help is appreciated. Thanks!
Don't Quit
|
|
|
|
|
|
Hi Pete! Thanks for your reply! But I'm looking for a COM component. Do you have any idea?
Thanks in advance!
Don't Quit
|
|
|
|
|
Nitin1981 wrote: Hi Pete! Thanks for your reply! But I'm looking for a COM component. Do you have any idea?
Try the Adobe Acrobat SDK for that:
http://www.adobe.com/devnet/acrobat/[^]
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
I have a combo box on form FrmFinance and it has lots of values and a "Other" selection. If you select it, a dialog window opens, Dialog1. What I want is that on Dialog1 form there is a textbox called txtMake and when you press OK btnOK on the dialog1 form, the item gets added to cmbmake (combo box) on FrmFinance. I don't want any values removed from the combobox, just add what is in the textbox when you press OK
Any ideas?
In the end we're all just the same
|
|
|
|
|
At Last found the solution to this problem previously I was also facing somewhat similar problem here is the solution which worked for me.
In your form2 declare a Class level variable of form type e.g.
Dim oForm as Form
now in the Load event of form2 just make this equal to the 'ActiveForm' property of frmFinance e.g.
oForm = frmFinance.ActiveForm
Now just enter the following code in the Button Click event handler or in whatever event you want to use in order to add items to the Combobox e.g.
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
CType(oForm, frmFinance).cboMake.Items.Add(Me.txtMake.Text)
End Sub
As it helped me I hope it help you too... Good Luck !
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
OK, but maybe you also want:
- to make sure the value is not already present;
- sort the values;
- remove some when there are too many values.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I got that to work, just changed "Dim oForm as Form" to "Public oForm as Form", thanks. Now how would I remove all items I added to combo box without removing all items? Also, when you click button, I want the combobox to focus on the new added item
In the end we're all just the same
|
|
|
|
|
i m using Smtp for sending mail. I m getting body text from an html editor. This editor uses webbrowser control. Problem is this, when i put an image on the webbrowser control and send it to a mailing address it don't show the pic but all the test is ok.
here's the code i use.
Dim MailObj As Net.Mail.MailMessage = New Net.Mail.MailMessage()
MailObj.To.Add("sampleemailaddress@exampledomain.com")
MailObj.From = New Net.Mail.MailAddress("myemailaddress@somedomain.com", "King")
mailObj.Priority = Net.Mail.MailPriority.Normal
MailObj.Subject = "This is test mail"
mailObj.Body = WebBrowser1.DocumentText
Dim smtpcli As Net.Mail.SmtpClient = New Net.Mail.SmtpClient("smtp.gmail.com", 587)
smtpcli.EnableSsl = True
smtpcli.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtpcli.Credentials = New Net.NetworkCredential("someemailaddress@gmail.com", "password")
Try
smtpcli.Send(MailObj)
MsgBox("Email successfully delivered.")
Catch ex As Exception
MsgBox(ex.ToString())
End Try
Thx in advance for any help.....
King
|
|
|
|
|
Try and change the mail type to HTML and then you can send anything formatted well in HTML.
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|