|
I deleted an old, unused column from a table in SQL Server that my app points to. I then removed any reference to that column in my app (variables, controls, etc.) I deleted and recreated the TableAdapter and DataTable for that SQL table in the DataSet designer so it would reflect the lack of that column. I even ran a search in my code for the column name. I run my app, and it works (i.e. I can pull a record from that DataTable) and all seems alright until I call Me.WorkRequestTableAdapter.Update(Record) (which is line 99 in the trace below). It then throws this exception:
System.Data.SqlClient.SqlException: Invalid column name '2AppID'.
Invalid column name '2AppID'.
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at BCI_Tracker.frm_Details.WorkRequestBindingNavigatorSaveItem_Click(Object sender, EventArgs e) in U:\VB\BCI Tracker2\BCI Tracker\frm_Details.vb:line 99
I have no idea where this is coming from. I have looked in the designer code for the form and the dataset. I still can't find where this exception is coming from?
I'm still quite new to vb.net, so I'm sorry if this is super easy, or if I broke a major best practice.
Any help would be great!!!
_____________________________________________________________________
Who's the only one here who knows the illegal ninja moves from the government? - Napoleon
|
|
|
|
|
The SQL for the Update in that TableAdapter is still referring to the deleted column.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Found it! Yup, I'm a rookie. I had spaced that I referenced the column in a Trigger I had setup in SQL! It had nothing to do with my VB.
|
|
|
|
|
Sir,
I want to make a program that generates the password.The program that generates password on any file or folder in the hard disk.I want to start it from the scratch.
Can i get the help .I mean from where should I start.
Please help.
Thanks.
|
|
|
|
|
Are you saying that you want to password protect any file/folder and you want whoever the user is to enter a password to open the file/folder?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Can anyone let me know how I can use an error provider control?
Thank you!
Sincerely,
Deepa!
|
|
|
|
|
Use it in one of your validation routines, for example, KeyPress, TextChanged, Validating events (I use a combination of all three events).
Put this at the top of your form class, before any procedures:
Private myErrorProvider As New ErrorProvider
Then, in your validation routine, if validation fails, set the error provider:
myErrorProvider.SetError(MyFormField, "Message to display")
To reset the error provider if validation is successful:
myErrorProvider.SetError(MyFormField, "")
Steve
|
|
|
|
|
Hi,
Is there a way to extract 'Address Book Groups' into a serialized format, such as :
<br />
<script language="vbscript"><br />
<br />
Dim oApp as Object, oAddressBook as Object ,_<br />
oGroup as Object, oContact as Object<br />
<br />
oApp = CreateObject("OutlookExpress.Application")<br />
<br />
<br />
oAddressBook = oApp.AddressBook<br />
oGroup = oAddressBook.Group<br />
oContact = oAddressBook.Contact<br />
<br />
Open "AddressBook_Backup.csv" for Output as #1<br />
For each oGroup In oAddressBook<br />
<br />
Output #1, oGroup.Name<br />
<br />
For Each oContact In oGroup<br />
<br />
Output #1, oContact.Name<br />
Output #1, oContact.Email<br />
<br />
Next oContact<br />
<br />
Next oGroup<br />
<br />
Close #1<br />
</script><br />
Another useful script could read that in and perform the necessary function of adding the groups and putting the correct contacts in the groups.
I shall be posing this question in the Lounge as well but excluding the code.
Any help would be great
Thanks in advance
Tom
|
|
|
|
|
I am in the process of crating a desktop management software that will incorporate VNC. RDP, and PcAnywhere. From looking at similar software such as PcAnywhere and VNC Scan, I want to be able put all the connection information in a file and save the file to a folder. Once the file is in the folder I want them to be listed using a “list view” function and displayed on the main menu. From their once I click on the file it will open the connection based on the information in the file. I have all the remote protocols working on separate forms and I can list the content of a folder in a list view. The biggest problem I am having is putting the connection information in a file (I.P. Address, Remote Protocol, etc) and calling that file from a list view.
http://www.vncscan.com/
http://www.symantec.com/home_homeoffice/products/features.jsp?pcid=pf&pvid=pca12
|
|
|
|
|
You could create your own ConnectionInfo class that stores this connection information and includes code to serialize itself. You can do this with the XmlSerializer[^] class.
-- modified at 15:20 Wednesday 30th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i work in project vb.net 2003 with sql server 2000 i make form to restore data base and i write this code
**********************************************
If File.Exists(Application.StartupPath & "\backup.txt") Then
Dim sreader As New StreamReader(Application.StartupPath & "\backup.txt")
Dim file_path As String
Dim fdialog As New OpenFileDialog
fdialog.Filter = "bak files (*.bak)|*.bak"
file_path = sreader.ReadToEnd
fdialog.InitialDirectory = file_path
If fdialog.ShowDialog = DialogResult.OK Then
file_path = fdialog.FileName
Dim sqlcom As New SqlCommand
sqlcom.Connection = CONN
sqlcom.CommandType = CommandType.Text
sqlcom.CommandText = "restore database ss from disk='" & file_path & "'"
Try
If CONN.State = ConnectionState.Open Then
CONN.Close()
End If
CONN.Open()
Me.Cursor = Cursors.WaitCursor
sqlcom.ExecuteNonQuery()
txtrestore.Text = file_path
Me.Cursor = Cursors.Default
Catch ex As Exception
MsgBox(ex.Message)
Me.Cursor = Cursors.Default
End Try
End If
End If
**********************************************
when i use this code an error occurred "database in use cannot restore it"
i need to stop used database so i can drop it and restore database
ma_refay
|
|
|
|
|
Dear All,
I am creating a Image Library and want to know what can the best and standard procedure to do this.
Concept is to have all the images needed by all projects (dlls and exes) in the product at a central place (in a single DLL) making it easy to distribute and maintain.
There are 2 ways of doing this.
1) Creating a new project, add all the images to it using "Add Existing Item" and set Build Action=Embeded Resource for each image.
OR
2) Creating a new project>Add new Item>Resources File and then adding all the images to it and setting Build Action=Embeded Resource for each image. Doing this will provide me a strongly typed DLL which will provide a property like access to all images. But .resx are mainly for localization. And here I am not localizing images.
My question is what is the standard way of doing this?
Do you guys know pros or cons of any of these methods?
Is anybody there knowing how Microsoft do it??? (When they need to create an image library)
Any links or articles for this?
Most important is, will the second (2) way will have any negative effect on start up time?
Regards,
----------------------------------------------------------------------------------
Jayvardhan Patil.
|
|
|
|
|
Hi Every Body
I asked before you about the way to export the DataSet into Excel Sheet, but I still have a problem in this subject...The code which I use is the following:
dim tblname as DataTable
Dim ExcelApp As Excel.Application = New Excel.Application
Dim Workbooks As Excel.Workbooks = ExcelApp.Workbooks
Dim Workbook As Excel.Workbook = Workbooks.Add(System.Reflection.Missing.Value)
Dim Sheets As Excel.Sheets = Workbook.Sheets
Dim Worksheet As Excel.Worksheet = Sheets("Sheet1")
Dim RowsCount As Integer = tblname.Rows.Count
Dim ColsCount As Integer = tblname.Columns.Count
Dim ColsCounter As Integer
Dim RowsCounter As Integer
'Columns Header
For ColsCounter = 0 To ColsCount - 1
Worksheet.Cells(1, ColsCounter + 1) = tblname.Columns(ColsCounter).ColumnName.ToString
'First Row for Columns Header
Next
For RowsCounter = 0 To RowsCount - 1
For ColsCounter = 0 To ColsCount - 1
Worksheet.Cells(RowsCounter + 2, ColsCounter + 1) = tblname.Rows(RowsCounter)(ColsCounter)
'Start With the Second Row Because First Row for Columns Header
Next
Next
ExcelApp.Visible = True
ExcelApp.UserControl = True
Note: After many searches over the Internet, I have found that the reason for the error in the previous code is named Late Binding, and I think that this is the main reason for the problem is what I said about the Late Binding. Is there any body know about this problem and the solution about it?
Simsem
|
|
|
|
|
You have not set the DataTable variable!
It should be something like:
Dim tblname As DataTable
tblname = MyDataSet.Tables("MyTable")
Then the rest of your code...
As it stands, the DataTable variable is empty.
Steve
|
|
|
|
|
The DataTable here is not empty because I am passing its value from another table using a query....so it is not empty
|
|
|
|
|
I don't see any kind of query in the code you posted...
You have just dimensioned your table and not assigned any data to it as far as I can see. Is there more code that you have not included?
Steve
|
|
|
|
|
The query exist in another form, I store the contents of the query in a DataTable and then pass this DataTable to my form where I display these data in a DataGrid and then I wanna Export these Data To Excel. So that be sure that there is a Data in the DataTable.
with Kind Regards.
your sincerely OBarahmeh
|
|
|
|
|
|
please help me with code which i can use to shutdown the application after 30mints, my application contains multi-forms and i want this code to be run when i click the start button on the second form "Form2".
Please note that i'm using the following code under the next or back buttons to switch between forms
< unload me
Form3.show >
as for example if i put timing code in Form2 , will this code stop when i click the next button which contains the code above?
Please advise and thank you for your help
Ali
|
|
|
|
|
Record the time when the user clicks on the "Start" button and start a timer (with a 1 minute interval) that will check the current time against the recorded one and close the application if 30 minutes have elapsed.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
This is a very smart way , but how can i record the time from the system clock and what will be the data type for the variable which i will store the time in it to compare with the current type.
Please advise and thank you for your help.
Ali
|
|
|
|
|
Have a look at the System.DateTime class.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi
This is the first time I am replying a query. All the Best!. Unless you unload the form that contains the Timer control you can keep count of the ticks.
In the timer control event you check for the period after which you want to close the application.
If it is visual basic, you can use this code,
Close All
End
If it is vb.net
Application.Exit
Hope this helps you.
Kanniah
|
|
|
|
|
hii all,
i have to devlop a vb.net application which works with pdf files.its a reader which upload pdf files and extract each page to JPEG format. but the core of the project depends on the "page turning effect(page flips over the reader while clicking Next/Previous button as in real magazine). i wuld like to add some graphics effect to the page flipping. i heard that ghostscript/postscript works with pdf files and these are providing graphics or curling effects to pdf pages. i want to deploy ghostscript/postsript code to vb.net application. Is It possible ? if yes, how ??
best regards
kannan
|
|
|
|
|
You can't use Ghostscript/Postscript in your VB.NET code. There is no component in the standard toolbox that understands those languages either. You'll need a 3rd party component that can render this stuff for you. I, unfortunately, don't know of any myself. You might want to try Googling for it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|