|
hehehe the sentence with the capitalize was good
|
|
|
|
|
Luc, before (and if) you answer him, please take a look at the message above about 3 replies up from this one. It will give you insight to his general attitude.
|
|
|
|
|
EliottA wrote: Luc, before (and if) you answer him, please take a look at the message above
I don't speak German but I know enough German words to understand what he said. Anybody who replies in this manner should be removed from CP forthwith.
|
|
|
|
|
mach nur, ihr hilfet mir ja sowieso ned vo dem her machs
|
|
|
|
|
|
Hello,
My database is not getting updated via dataset even all the fields in the form have been binded to validation occurs. When I push the button I want to transfer dataset to database. However when I browse the database to see if there are the most recent changes from dataset, There is no record! What am I missing? I am not getting any error messages.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Row As DataRow = ProjectsDataSet1.Tables("Projects").NewRow()
Try
Me.Validate()
Me.ProjelerBindingSource.EndEdit()
Me.ProjelerTableAdapter.Update(Me.ProjectsDataSet1.Tables("Projects"))
MessageBox.Show(ProjectName.Text & vbCrLf & vbCrLf & "identified!")
Catch ex As Exception
MsgBox("Identification is not successful.")
End Try
Me.Close()
End Sub
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
It is difficult to give a precise answer, as there can be many causes for your problem.
Are you trying to add a row to an empty table? Trying to update existing data? Or what?
You need to restate your question more clearly.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
It is an empty table inside the dataset. There are no records. I have a form and there are fields binded to dataset which means if a validation occurs, the entries will be automatically added in to table. However it does neither add a record nor at the end of update it does update the table in database (not in dataset).
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Does the SQL that was used to return the data from the database return that table's Primary Key column?
|
|
|
|
|
In the code you posted, you create a new DataRow, but you never do anything with it.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Row As DataRow = ProjectsDataSet1.Tables("Projects").NewRow()
........................
........................
........................
Me.Close()
End Sub
To try to get this working I will suggest a solution using the code that you already have.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Row As DataRow = ProjectsDataSet1.Tables("Projects").NewRow()
Row("FirstName") = textBoxFName.Text
Row("LastName") = textBoxLName.Text
ProjectsDataSet1.Tables("Projects").Rows.Add(Row)
Try
Me.Validate()
Me.ProjelerBindingSource.EndEdit()
Me.ProjelerTableAdapter.Update(Me.ProjectsDataSet1.Tables("Projects"))
MessageBox.Show(ProjectName.Text & vbCrLf & vbCrLf & "identified!")
Catch ex As Exception
MsgBox("Identification is not successful.")
End Try
Me.Close()
End Sub
I have not tested this but it should work. Give it a try and get back, if not.
You do realise that your Me.Close() line will close the form, don't you?
Possibly a better way to do this is to give the users a 'New' button. When this is clicked, add a new row to the table and leave it blank. Then since your data entry controls are bound to the table they will be looking at this empty row so that when data is entered into the controls it will also be added to the table. You could then use your Button1_Click as it is except for the NewRow() line, which will no longer be needed.
Hope this makes sense, and helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry!
Yes I did it with the way as you have suggested but it is not working at all.
I don't understand why do I have to assign a new row for the table if I have already bind all the fields in the form to fields in the table in dataset. Whenever validation occurs in the form, I assume that it should create a new row in the table in dataset. Am I wrong about it?
The otherwise it doesn't make enough sense to use dataset because I have to add statetements for each row e.g (Row("Name") = ProjectName.Text).
I could solve the problem with SQL and dataadapter but my aim is to learn how to use dataset.
The table is empty ib both dataset and database. I am trying to create the first record with the use of dataset and then transfer dataset to database.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
You may have already seen this but in case you haven't, take a look at How to: Insert New Records into a Database[^] on MSDN.
JUNEYT wrote: I don't understand why do I have to assign a new row for the table if I have already bind all the fields in the form to fields in the table in dataset.
You have to assign a new row so that there is somewhere for the new data to go. An empty table has no rows and therefore does not have anywhere to put your data. If your table already has data, your controls will be showing that data and any changes to their contents will change the existing data, therefore requiring a new row as before.
Something has occurred to me. When I was starting out with DB stuff, I had a similar mysterious problem. In my case it was something really silly. You might want to check this for your application. If you select your database in Solution Explorer then hit F4, the Properties Window will open for the file. Fairly near the top you should see a 'Copy to Output Directory' entry. Is that set to 'Copy Always'? If so, change it to 'Copy if Newer' because otherwise what happens is that every time you run your app, the empty DataBase is copied over the one with the data in it. Oh how I laughed, when I found that. NOT!!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Guys,
im not sure if this is possible,
Say for eg. I have an application running which has a global variable "User" Declared.
i want to retrieve the value stored in "User" from another application.
how can this be done?
if so, can you direct me to the link?
much appreciated,
thanks
Anoop
|
|
|
|
|
Anoop Brijmohun wrote: I have an application running which has a global variable "User" Declared.
i want to retrieve the value stored in "User" from another application.
how can this be done?
You cannot just reference it like any other variable. You actually have to have some kind of communication mechanism in place that both applications support. Though, for the value of a single variable, it sounds like some bad design choices were made designing these apps and setting up communication just to transfer a single value is overkill.
Another possibility, though not available until .NET 4.0, would be a memory-mapped file. Both applications basically "share" a common file that exists in memory and can read/write to that file. Though, if sychronization is needed, you'll also need some kind of mechanism in place, depending on your requirements.
I would think you need to go back as see if the value can be stored in a well-known place and retrieved by both apps as needed.
|
|
|
|
|
Hi
Thanks For You Response.
The App 1 is not my application, its part of an ERP System created by someone else.
Within the App1,there are variables that can be called by built in script editors.
mmmm... just thought there might be a simple way to access that specific variable.
The whole idea behind was that i was building an app [2] to run automated task
and instead of the user logging in again, i would be able to get the logged in user from app1 and process.
thanks.
Anoop
|
|
|
|
|
If you have no control over App1, you've pretty much out of luck. Unless that app exposes some kind of COM interface that you can use to get at the variable.
|
|
|
|
|
Supose I have default windows printer always in Pause because I want to control jobs send by users.
Using system.printing I detect jobs and I want to decide if this may be printed or not.
If I decide to print I want to send the job to another on-line printer.
Is possible to change a job in default printer queue to another printer queue ?
The job depends on printer and the on-line printer must use the same driver or the printer may be different ?
|
|
|
|
|
edmonson wrote: Is possible to change a job in default printer queue to another printer queue
No. Once the job is created, it cannot be changed. You'd have to kill the job and have the application that generated it send it again using the new printer (good luck with that part, you'll need it!)
|
|
|
|
|
|
|
This sounds like a horrifying user interface design. but, whatever, it's your customer...
Ask this in the ASP.NET forum. What you're asking really has nothing to do with the language you're writing this in, but the web technology you're using.
|
|
|
|
|
Dear all,
I want to know about the Local Language Settings in VB 6 application.
I have one application in VB6 which i need to interpret with My Local Language in to my application Front Screen. Can anybody having the info please let me also know.
Thanks in advance.
Jay
|
|
|
|
|
|
It's called "localization". All you have to do is Google for "vb6 localization" and you'll come up with an ever-dwindling list of articles to read.
VB6 is dead and has been for quite some time now. I strongly suggest downloading VB.NET 2008 Express Edition, since it's free.
|
|
|
|
|
Good Time for U all,
I am working on an application, I want to read data from excel based on conditions like for example "select somecolumns from [excelsheet$] where acolumnname="somevalue". Is that possible to do so. Can anyone help me in do so or give me other clues for my purpose.
With regards,
|
|
|
|