|
Well Dave you Solved the Problem, here is a Complete Code
<br />
Dim newRow As DataRow = DataSet11._PROPERTY.NewRow<br />
newRow("Num_key") = CStr(txtnumkey.Text)<br />
If txtextension.Text.Trim = Nothing Then<br />
newRow("Extension") = DBNull.Value<br />
Else<br />
newRow("Extension") = txtextension.Text<br />
End If<br />
and Now i have i have to save the Dataset to the Database by with the Update method. here is my code
<br />
Dim strErrorMsg As String<br />
Dim strerror As System.Data.SqlClient.SqlError<br />
'save the datasource Changes<br />
If mblnIsDirty Then<br />
If MessageBox.Show("Do you want to Save the Changes?", "Property", _<br />
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then<br />
' Checking for Error in the dataset<br />
Try<br />
SqlDataAdapter1.Update(DataSet11, "Property")<br />
Catch<br />
MessageBox.Show("Error saving Data in the DataBase", "Property")<br />
<br />
End Try<br />
End If<br />
End If<br />
if i try to update, it Brings
<br />
An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll<br />
<br />
Additional information: Missing SourceTable mapping: 'Property'<br />
-- modified at 12:02 Monday 2nd July, 2007
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: SqlDataAdapter1.Update(DataSet11, "Property")
Apparently, you don't have a datatable in DataSet11 (very bad name by the way), called "Property".
|
|
|
|
|
Thanks Dave for your time.
yes i know that the Table "Property" named i used is very Bad, but its the name of the table, sometimes to find my way around in my code i had to prefix it with an underscore, because Property is a keyword in VB. i have redefined the Dataset11 and it does not give an error anymore, but still the data does not reflect in my table.
<br />
Dim strErrorMsg As String<br />
Dim strerror As System.Data.SqlClient.SqlError<br />
'save the datasource Changes<br />
If mblnIsDirty Then<br />
If MessageBox.Show("Do you want to Save the Changes?", "Property", _<br />
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then<br />
' Checking for Error in the dataset<br />
Try<br />
<br />
SqlDataAdapter1.Update(DataSet11, "Property")<br />
Catch ExSQL As System.Data.SqlClient.SqlException<br />
MessageBox.Show(strErrorMsg, "SQL Server Error: " & strerror.Number, MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
End Try<br />
End If<br />
End If<br />
let me find a way out of this, if i dont i will shout
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: yes i know that the Table "Property" named i used is very Bad,
No, I said the name of the DataSet object is very bad.
Vuyiswamb wrote: sometimes to find my way around in my code i had to prefix it with an underscore, because Property is a keyword in VB.
So? "Property" isn't used to describe a .NET object anywhere in your code. It's just the name of a DataTable, which is perfectly legal.
Vuyiswamb wrote: but still the data does not reflect in my table.
You're going to have to step through the update code and look at the values of variables so you know what your code is thinking. Perhaps that "dirty" variable isn't set? Perhaps there are no changes in the "Property" table in your DataSet?
|
|
|
|
|
Sorry About that Dave, the Update method was working just that there was Data comming into my table, so after inserting new records , when i checked the last Record, it was not what i used for testing. so i searched them and i found them
Thank you Dave for you time. let me Paste my update code for user who will have the same Problem. here is the Solution.
<br />
If mblnIsDirty Then<br />
If MessageBox.Show("Do you want to Save the Changes?", "Property", _<br />
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then<br />
<br />
<br />
If checkerrors() Then<br />
MessageBox.Show("Your Dataset has Errors")<br />
Else<br />
SqlDataAdapter1.Update(DataSet11, "Property")<br />
End If<br />
<br />
End If<br />
End If<br />
here is the CheckErrors() function code
<br />
Private Function checkerrors() As Boolean<br />
<br />
<br />
Dim table As Data.DataTable<br />
Dim row As Data.DataRow<br />
SqlDataAdapter1.Update(DataSet11, "Property")<br />
If DataSet11.HasErrors Then<br />
<br />
For Each table In DataSet11.Tables<br />
If table.HasErrors Then<br />
Return True<br />
For Each row In table.Rows<br />
If row.HasErrors Then<br />
MessageBox.Show("Dataset has Errors")<br />
' Process error here.<br />
<br />
End If<br />
Next<br />
ElseIf table.HasErrors = False Then<br />
Return False<br />
MessageBox.Show("Dataset has no Errors")<br />
End If<br />
Next<br />
End If<br />
End Function<br />
Thanks for your time and Help
Vuyiswa
|
|
|
|
|
So if i choose '0' will it Show in the '0' table? i need it to show Null. how can i do that one
Vuyiswa
Vuyiswa
|
|
|
|
|
I think you want to replace the "Null" string with DbNull.Value .
|
|
|
|
|
If you need null as a string, you can't use a numeric table.
"text" != number
However, you can set it as a dbnull value - DbNull.Value
|
|
|
|
|
I've an application developed in VB.Net 2003 and MS access 2003. This works fine with US settings.
But when I change my regional settings to Bosnian or Croation and try to execute query it gives me error:
The Microsoft Jet database engine could not find the object [FieldNameInDatabaseTable]. Make sure the object exists and that you spell its name and the path name correctly.
[FieldNameInDatabaseTable] is the last field in the table. I tried reducing the number of fields in table to one. But no luck.
Any help available on this?
Regards,
Nilesh.
|
|
|
|
|
have you checked all the connetion settings? the odbc bridge?
|
|
|
|
|
Yes! i've checked everything. It works fine with US settings and some other settings also.
But for some regional setttings it fails.
For settings like Zulu it fails.
|
|
|
|
|
first of all: I don't really know if this is the place to ask, if not forgive me for I didn't find an other threat
My boss asked me to look into the possabilty of using vb.net user controls in access 2007
Now I'm pretty new to access (only been using it for a month now) so I really don't have any idee of how to get started at this (or if it is even possible).
Any help with this would be appriciated.
I'm normally a vb.net programmer so creating the user controls is now problem. Just getting them to work in access is.
|
|
|
|
|
First google result: (searched for "vb.net" controls in ms access )
Customize Microsoft Office toolbar. Any .NET controls for Office ...[^]
This looks like what you might want...
From the site:
With Add-in Express you can:
Develop COM add-ins for ten main Microsoft Office applications, including Microsoft Outlook, Microsoft Excel, Microsoft Word, Microsoft PowerPoint, Microsoft Access®, Microsoft Visio®, Microsoft Project,
Microsoft MapPoint®, Microsoft FrontPage® , Microsoft Publisher and Microsoft InfoPath.
Create your custom toolbars and toolbar items in Microsoft Outlook Explorer and Microsoft Outlook Inspector (message window).
Control all Microsoft Outlook’s built-in commandbars /toolbars including context-sensitivity pop-ups.
Create your own toolbars in Microsoft Excel, add command bar controls, handle Microsoft Excel events and "hook" any built-in toolbar controls.
Use a lot of other Add-in Express features not mentioned here.
|
|
|
|
|
Hi,
I'd like to know how i can get the name and path of the virusscanner and firewall installed (if any). I looked for it but i only found examples for VS 2005 i am using VS 2003. NOTE: I AM NOT MAKING A VIRUS!, i am making a SecurityCenter. I only have to read the data, not write it. Anyone got any suggestions?
--Zaegra--
|
|
|
|
|
I'm not sure if its possible but can't you look up witch programms are installed and then eliminate the one's you don't need.
Or wich services ar running and look at the description.
Like I said don't know if its possible like this but from what you discribe to me I would search in that direction
|
|
|
|
|
You could probably search the registry or program files directory for something like "Norton" or "McAfee".
|
|
|
|
|
Until XP Service Pack 2 came out, there was no standards for manufacturers to follow, so every one puts their registry keys in various places and each has different values and formats for data, including version information.
Unless you tell your app how to find each version of each package you want to support, you're going to have a difficult time with this.
The post XPSP2 era has the standard layed out by the Microsoft's Security Center. This information is available through WMI in the root\SecurityCenter namespace, but documentation on the classes and methods in this namespace is nearly non-existant. You'd have to get a tool such as WmiStudio to do some investigation on your own on how these classes work.
|
|
|
|
|
Hi all,
I'd like to know how i can print a form as an image (with color) in vb.net, using Visual Studio 2003. I found the PrintForm control of Microsoft for VS 2005 but it does not support VS 2003. Any help, please?
--Zaegra--
|
|
|
|
|
I battled this problem too a while back didn't find a solution but did find a work around with may be good enough.
The way I did it was that I took a snapshot of the form and then saved (or print) it.
the downside to this is that the form has to be active and there can't be anything above it.
its like pressing the printscreen button on your keyboard only just from your form (or a panel or something like that)
if you want the code too do this just email my (I'd post it here but can't seem to find a attachment button )
Like I said this is a work-around and there will almost definatly be better ways to do this but due to lake of time I settled for this and it worked fine for me soo...
-- modified at 9:29 Monday 2nd July, 2007
Probably better give my email : tom.deketelaere@gmail.com
|
|
|
|
|
Hi all,
Is there any way to search for a string and modify entire line of text file using VB.net ?
Thanks
Sridhar...
|
|
|
|
|
|
Load the text file into memory, search for and replace what you want using normal array and string operations, then write the modified file back out.
If your file is too big to fit in memory, you'll have to use other techniques described in this article[^].
|
|
|
|
|
hi everyone,
1 m newbie for Drawing class .i created PNG through programmatically.Everything in fine Except Width & height of PNG. i draw a PNG based on string, input by User
at starting time I fix the size(height & Width) of PNG. but even for single character it takes same size as i specified. whether there r any option to remove White pixcel (where red ,green,blue equal to 255 for row from top or bottom ,and for any column from Left or Right)
any help will be appreciated
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
You already asked this question and you already got your answer. You cannot reduce the size of the image because PNG is already a compressed format.
|
|
|
|
|
sorry sir for asking same question once again.
i m newbie in Drawing class . so i don't described my problem in correrct manner.so i post same question once again.
by the way i find the solution to reduce the PNG image to 150 Bytes(before it takes above 1KB for single word of some character)
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|