|
Hi,
I'm using the following code to update my database but the changes in my data table never reflected back to my database
<br />
<br />
Dim aDataTable as new aDataSet.MyTable<br />
Dim aTableAdapter as new aDataSetTableAdapters.MyTableTableAdapter<br />
<br />
aTableAdapter.Fill ( aDataTable )<br />
<br />
Dim aRow as DataRow<br />
<br />
aRow = aDataTable.NewRow()<br />
aRow.item(0) = "Test 123"<br />
<br />
aDataTable.Rows.Add ( aRow )<br />
<br />
aDataTable.AcceptChanges()<br />
aTableAdapter.Update( aDataTable )<br />
<br />
What have I miss ?
Thank you
WiL
|
|
|
|
|
You're calling the .AcceptChanges() method to commit the changes to the DataSet, not the database. Call the DataAdpter 's .Update() method BEFORE you call AcceptChanges
Update commits any changes back to the database.
AcceptChanges commits any changes to the DataTable and resets each DataRow's status to Unchanged . This is why no changes are being written back to the database. Because you've told the table there are no changes!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You're the best!
Thanks alot
WiL
|
|
|
|
|
is there another way of comparing duplicate picture (jpg)
aside from filename, filesize and dates
tnx in advance
|
|
|
|
|
You could try doing a SHA1 hash on it. There's C++ code that does it on CP but I'm not sure about VB/VB.NET.
Steve
|
|
|
|
|
Could someone please explain to me the easiest way in code to compare two files?
I have created an openfiledialog to select 2 files and would like to compare them. I looked at msn but got very confused. If you don't mind taking the time to show me an example that would be wonderful.
Thanks again.
Win32newb
"If I wrote a book like I code. It would be one page thick and contain only one word (DUH!)"
|
|
|
|
|
|
hello everyone!! I am a student from India. I need the source code for implemention of sobel and canny edge detection for tumour image analysis.If anyone knows where I can get it or has the source code please please notify.
signing off is preci
|
|
|
|
|
|
I'm getting a extra space added to a records fields when I update the record. This is a VB6 Access DB application.
The only thing I can think of is the SQL
<br />
strSQLEditCustomer = "UPDATE Customers SET ContactFirstName = ' " & txtFName.Text & " ' , ContactLastName = ' " & txtLName.Text & " ' , BillingAddress = ' " & txtAddress.Text & " ' , City = ' " & txtCity.Text & " ' , State = ' " & CboState.Text & " ' , PostalCode = ' " & CboZip.Text & " ' , PhoneNumber= ' " & txtPhone.Text & " ' , EmailAddress = ' " & txtEmailAddress.Text & " ' WHERE CustomerID = " & SearchCustID & " "<br />
|
|
|
|
|
I figured it out. FYI for those who may come across the same problem
in the SQL when filling a table field and your setting it = to a textbox, the ' " & textbox1.text & " ' will result in the space added to the beginning of the field. changing the SQL to '" & textbox1.Text & "' will fix the problem. Note the difference in the placement of the single quotes between the 2 examples.
|
|
|
|
|
|
Hi,
Jlawrnce wrote: strSQLEditCustomer = "UPDATE Customers SET ContactFirstName = ' " & txtFName.Text & " ' , ContactLastName = ' " & txtLName.Text & " ' , BillingAddress = ' " & txtAddress.Text & " ' , City = ' " & txtCity.Text & " ' , State = ' " & CboState.Text & " ' , PostalCode = ' " & CboZip.Text & " ' , PhoneNumber= ' " & txtPhone.Text & " ' , EmailAddress = ' " & txtEmailAddress.Text & " ' WHERE CustomerID = " & SearchCustID & " "
Use "Trim" method to supress the extra space
from the controls
like
"UPDATE Customers SET ContactFirstName = '"& Trim(txtFName.Text) &"'"
This will also help you.
Pankaj Kulkarni
|
|
|
|
|
Hi,
How to create Navigation Panel similar to the navigation panel seen in Microsoft® Outlook 2003, in vb.net.
waiting your answer.
|
|
|
|
|
|
|
Hello everybody,
how can convert date (in numbers) into the text format(string) in vb.net.
thank n take care.
bye...
|
|
|
|
|
You need to use the Date[^] type.
Dim myDate As New Date(myYear, myMonth, myDay)<br />
Dim myString As String = myDate.ToShortDateString()
|
|
|
|
|
.tostring?
example:
dim tDate as date= today
dim tDateStr as string = tDate.tostring
|
|
|
|
|
Hi all,
In a program developed in VB6 I've included a Datagrid. In the machine where I've developed the application all works fine but if I install the program (including and registering MSDATGRD.OCX) the program executes correctly except that the datagrid doesn't show the data and I've ensured that there are records in it.
Any ideas on how to solve it?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hi all,
I've found the resolution right now. The item was that I needed to set the datasource of the datagrid when the form is loaded and not in the properties page pf the datagrid control. I don't knoow why (If anyone knows it, please, tell me) but in the developing machine the datagrid was populated and in the destination machine where VB6 is not there the datagrid was empty.
Marc.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I situation is I need to pull the data from an Excel Spreadsheet and Insert it into a SQL Server DB.
connecting excel via OleDb connection:
strExCN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileName & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
which is connecting as it should.
I hope someone can lend a hand on this. I can open the excel file and begins to read but when I come across an empty file I get a dbNull error.
I have changed my select statement from
"select * from [worksheet$]" to
"select isnull(ColumnName, '') from [worksheet$]" and now am receiving and error saying
OleDbException was unhandled
Wrong number of arguments used with function in query expression 'IsNull('Column Name', '')'.
Any help on this error would be wonderful. Thanks in advance
culby sl
|
|
|
|
|
culbysl wrote: I can open the excel file and begins to read but when I come across an empty file I get a dbNull error.
When you come acrossed an empty Excel FILE?? Or Cell??
If it's an empty file, you can just capture the error in a Try/Catch block and move on:
' Setup connection stuff...
' Setup your loop, enumerating your files...
Try
' Open the connection
' Execute the SELECT statement
Catch ex As Exception
' Handle the emtpy file problem here...
Finally
If connection is not closed then
Close connection
End Try
' Loop around to process the next file...
culbysl wrote: Wrong number of arguments used with function in query expression 'IsNull('Column Name', '')'.
You can't use Excel functions in the SELECT statement because Excel is not doing the processing here. You should either stick with the * or specify the columns you're actually goint to use.
Now, if your code is bombing try to use a DBNull value from a cell, then your code has to check to see if that value is DBNull before trying to use it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Anyone knows how to generate PDF File using VB.net?
Thanks
|
|
|
|
|
1) you can buy a 3rd party package which allows you to create reports
2) you can use ReportDocument from .Net BCL and the "report viewer" has the option to export it into PDF/Excel/Word etc.
3) Install PDF driver on the client machines first (Free PDF print driver (no ads/spyware)[^]. Create PrintDocument and perform your custom drawing. Print to this printer.
- Malhar
|
|
|
|