Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

newbjohny

@newbjohny
About
Posts
23
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to close all open MDI children without closing the Parent
    N newbjohny

    I managed to get it done, I pasted the code underneath incase someone else has a similar problem. John Dim form As System.Windows.Forms.Form For Each form In Me.MdiChildren form.Close() Next form

    Visual Basic database tutorial

  • How to close all open MDI children without closing the Parent
    N newbjohny

    Hi, I am creating a GUI to a database, I would like to know when I click a button to open a new database, all open MDI children relating to the old database that are open are closed without closing the parent form. I stored the name of the parent form into a module and tried this, but it only closes one, if there are more than one it does not work. ParentName.mdif.ActiveMdiChild.Close() Any suggestions are greatfully appreciated. John

    Visual Basic database tutorial

  • Specified cast is not valid
    N newbjohny

    Hi, I have now fixed this problem, my MDACs were not up to date, so once I updated these everything worked fine. Thanks again. John.

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Hi Joe, I have declared tblName as a String at the top of the form as it is used a few times throughout the form. setTableName(tblName) is a method within a Module I created to store the name of the table in the database I am using so that I can use it in another form with the method getTableName. I've looked through and can't find any errors, like I said before it works fine at University. I emailed someone my project from another forum and they said it worked fine on their pc also so were unsure as the problem, theyve uploaded it to the forum if anyone wants to download it and look at the code first hand they can. It is message 12 by user "doWhileSomething" and the program is in the link Program, the forum is at :- http://www.vbcity.com/forums/topic.asp?tid=131204&page=2&#RID424741

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Ive just never heard them be called this before, in the dbConnection class there is :- Public tableNames() As String Public indexNames() As String Public triggerNames() As String Public viewNames() As String Public columnNames As New ArrayList() Public columnTypes As New ArrayList() Dim tables, i As Integer Dim sqlite_conn As SQLiteConnection Dim sqlite_cmd As SQLiteCommand Dim sqlite_datareader As SQLiteDataReader Dim sqlite_dataAdapter As SQLiteDataAdapter Dim dset As DataSet = New DataSet() Dim sqlite_commandBuilder As SQLiteCommandBuilder Private data_Table As New DataTable() Private rowPos As Integer = 0 in the viewdata form there is :- Dim dbConn As dbConnection = New dbConnection() Dim tableName As String Dim tblName As String

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    I think I should be just glad it works at University and leave it at that. Thanks again for your time and help, much appreciated. John

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    It's very weird as you would suspect it to either work on both my home and Uni PC's or neither, not to work on one and not the other. Anyway thanks for your help and suggestions, they were very much appreciated. Thanks again John

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Hi Steve, the sqlite_*** are my names I've given to them. Like in the code above, I've simply added the _ so when I come to use it elsewhere I know what it is, so SQLiteCommandBuilder becomes sqilte_commandBuilder. It's just easier for me. They come from a 3rd party wrapper which is finisar.sqlite which can be found at http://adodotnetsqlite.sourceforge.net/ the expected line of "Dim sqlite_commandBuilder As SQLiteCommandBuilder" is present and has been declared at the top of the dbConnection class with all the other things that need declaring. Now that you mention it I don't know what those two lines are doing, they are there from when I started this project a long time ago and as it was working I never took anything out. I've took them out and they makeno difference to the error messge so it looks as if they were not needed at all. -- modified at 12:47 Saturday 5th August, 2006

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    This is the selectAll code, I just called it selectAll(select *) as that is what I am doing from the database, selecting all from a table and displaying it to the user. Public Function selectAll(ByVal strSQL As String, ByVal tableName As String) Dim dset As DataSet = New DataSet() sqlite_cmd.CommandText = (strSQL) sqlite_datareader = sqlite_cmd.ExecuteReader() Dim sqlite_dataAdapter As SQLiteDataAdapter = New SQLiteDataAdapter(strSQL, sqlite_conn) sqlite_commandBuilder = New SQLiteCommandBuilder(sqlite_dataAdapter) sqlite_dataAdapter.Fill(dset, tableName) Return dset End Function

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    No, the function is in a dbConnection class and the cmbinsertdata is on a form. I'm sorry but I do not know what a member variable is. Is there someway I could zip my code and email it to you, it may be easier if you could see the code. John

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    The previous two messages I wrote were from the Call stack. dbConnection is a class I created with all functions in that deal with the database. In the forms I want to connect to the database I put this line of code:- Dim dbConn As dbConnection = New dbConnection() selectAll is a function I created to select all from the given table name, put the contents into a dataSet and display in a DataGrid.

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    dbConnection is a class I created with all functions in that deal with the database. In the forms I want to connect to the database I put this line of code:- Dim dbConn As dbConnection = New dbConnection() selectAll is a function I created to select all from the given table name, put the contents into a dataSet and display in a DataGrid.

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Hi, sadly they did not teach us to do anything other that the try and catch, to be honest they never really taught us, all the lecture notes were ripped straight from the recommended text book. Anyway thats a aside issue. I've taken out the try-catch and it still crashes out with the same error, but two lines of code are highlighted, the one mentioned earlier in the form :- dset = dbConn.selectAll("SELECT * FROM " & tblName, tblName) and one in selectAll function in the connection class:- sqlite_dataAdapter.Fill(dset, tableName) A third line is highlighted in dissassembly but I have no idea what this is :- 00000014 mov ecx,eax

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    No I am not notified of a missing reference, sorry, I did highlight the line but then when I put the code in code tags it must have got rid of the bold, the line that causes the error is this one :- dset = dbConn.selectAll("SELECT * FROM " & tblName, tblName) John

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Hi Steve, I have tried re-referencing all the references which are present, this does not fix the error. Is there anyway I could find out what DLL could be missing or should I just leave it and be thankful it works at University? John

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Hi Colin, I am not really sure what you mean, how do I get all the other good information? I have been taught this way at University so as not to crash out the program. What I find odd is that it can work on one machine and not the other.

    Visual Basic help question announcement csharp database

  • Specified cast is not valid
    N newbjohny

    Hi, I am using VS.Net 2002 edition with the 1.1 framework both at University and at home (my home copy is from University using the University licence so I presume is exactly the same) I have created a front-end application for SQLite (an open source DBMS) which creates databases for users with no SQL knowledge. I link to the DBMS using a .dll file. When I fill a dataset with the contents of a table at University it works fine then goes onto fill a datagrid with this information. Yet when I run the same application at home I get a "Specified cast is not valid" error. Not one thing changes to the application, the data in the table, the .dll file, everything is the same in the two instances yet one works and the other doesn't. Does anyone know what is wrong, if I need to change a setting or install an update on my home PC or something? Any help is greatly appreciated. I have included my code and highlighted where the error shows up although I do not believe my code to be the problem as like I said it works on the University PC's. Many thanks John Code for populating dataset and datagrid Private Sub cmbInsertData_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbInsertData.SelectedIndexChanged Dim dset As DataSet '= New DataSet() If Len(cmbInsertData.SelectedItem) < 1 Then MessageBox.Show("Please choose a table to view") Else Try tblName = (cmbInsertData.Text) setTableName(tblName) dbConn.openExistingDatabse("Data Source=" & getDBName() & ";Version=3;New=False;Compress=True;") dbConn.createSQLCommand() Try dset = dbConn.selectAll("SELECT * FROM " & tblName, tblName) Catch es As Exception MessageBox.Show("error here -" & es.Message) End Try StoreDataSet.setDataSet(dset) DataGrid1.DataSource = dset.Tables(0).DefaultView Catch es As Exception MessageBox.Show(es.Message) End Try End If End Sub Public Function selectAll(ByVal strSQL As String, ByVal tableName As String) Dim dset As DataSet = New DataSet() sqlite_cmd.CommandText = (strSQL) sqlite_datareader = sqlite_cmd.ExecuteReader() Dim sqlite_dataAdapter As SQLiteDataAdapter = New SQLiteDataAdapter(strSQL, sqlite_conn) sqlite_co

    Visual Basic help question announcement csharp database

  • Problems updating a dataset
    N newbjohny

    Hi, thanks foryour advice, I havesince managed to get the dataset working. Many thanks John

    Database help announcement database sqlite

  • Problems updating a dataset
    N newbjohny

    Hi, I am having trouble in updating my dataset, I create a dataset from a select command and display the details to a datagrid. I then goto the next new line in the datagrid and insert some new details then click the insertRow button (code below) and I get the following error message :- the exception which is caught states : - "Value cannot be null. Parameter name: dataset" I am not up to scratch with datasets, but all examples I can find of updates are where only one line of the dataset is shown at a time in text boxes and then a blank set of textboxes are displayed to add a new row then convert the textboxes.text to the add row command, but I am creating an application to be a front end to a database so none of the columns are known so I cannot create this form of input as the amount of textboxes would never be known. Please help Many thanks John Code for updating dataset [CODE] Private Sub btnInsertRow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsertRow.Click Dim dset As DataSet tblName = (cmbInsertData.Text) dbConn.openExistingDatabse("Data Source=" & getDBName() & ";Version=3;New=False;Compress=True;") dbConn.createSQLCommand() Try dbConn.updateDataSet(dset, tblName) Catch es As Exception MessageBox.Show(es.Message) End Try End Sub[/CODE] [CODE] Public Sub updateDataSet(ByVal dset As DataSet, ByVal tableName As String) Dim sqlite_dataAdapter As SQLiteDataAdapter = New SQLiteDataAdapter() sqlite_commandBuilder = New SQLiteCommandBuilder(sqlite_dataAdapter) sqlite_dataAdapter.Update(dset, tableName) End Sub[/CODE]

    Database help announcement database sqlite

  • Populating a comboBox with an ArrayList
    N newbjohny

    Hi, thanks for this, works a treat, I can't blieve I forgot to use the array. Thanks again John.

    Visual Basic csharp help announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups