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
H

hobbsieoz

@hobbsieoz
About
Posts
14
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQLCE C# Not Selecting New Records
    H hobbsieoz

    I am developing a C# Windows Application which inserts data into a SQLCE database. It inserts fine, that works great! However, if i want to select the new record from the database, it comes back as a blank result. I can search for previous records before i opened the applications. Its as though the database opens a cached copy, and you can only insert into it. Here is my current code. Has anybody else had similar issues.

        private void button2\_Click(object sender, EventArgs e)
        {
            if (txtAddRegistration.Text != "")
            {
                if (comboAircraft.Text != "")
                {
                    if (comboAirline.Text != "")
                    {
                        if (comboLocation.Text != "")
                        {
                            int picyesorno;
                            string picloc;
                            if (txtAddPicLoc.Text == "")
                            {
                                picyesorno = 0;
                                picloc = "";
                            }
                            else
                            {
                                picyesorno = 1;
                                picloc = txtAddPicLoc.Text;
                            }
                            string InsertRegCommand = "INSERT INTO SPOTTINGLOG (registration, aircraft, airline, location, date, pictured, picloc, comments) values('" + txtAddRegistration.Text + "','" + comboAircraft.Text + "','" + comboAirline.Text + "','" + comboLocation.Text + "'," + dateTimePicker1.Value.ToShortDateString() + "," + picyesorno + ",'" + picloc + "','" + txtAddComments.Text + "')";
                            string database = @"D:\\Daniel\\Documents\\Visual Studio 2008\\Projects\\AviationSpottingLog\\AviationSpottingLog\\SpotData.sdf";
                            try
                            {
                                SqlCeConnection conn = new SqlCeConnection("Data Source=" + database);
                                conn.Open();
                                SqlCeCommand command = new SqlCeCommand();
                                command.Connection = conn;
                                command.CommandText = InsertRegCommand;
                                command.ExecuteNonQuery();
                                conn.Close();
                            }
                            catch
                            {
                                
                            }
    
    C# csharp database visual-studio

  • SQL Select Value to String
    H hobbsieoz

    Can anybdoy help?

    C# question database

  • SQL Select Value to String
    H hobbsieoz

    Ok. How do i get the result into a string?

    C# question database

  • SQL Select Value to String
    H hobbsieoz

    This is probably a really easy question, but i need to select a value from an SQL table and put it in a string. The table - PRODUCTS, has a column called QTY and a column called ID I need to select the QTY value where ID = x. How do i select the single value and put it into a string?

    C# question database

  • Active Directory - Null Reference Exception
    H hobbsieoz

    Ive followed the link. And changed it to all lowercase. And replaced .value with .invokeget. Still no avail

    C# com windows-admin question

  • Active Directory - Null Reference Exception
    H hobbsieoz

    Hi Im trying to retrieve user properties from active directory. It successfully gets the first required property, but after that all i get is 'NullReferenceException - Object reference not set to an instance of an object' Why is this? Here is the code: DirectoryEntry standardUser = new DirectoryEntry("LDAP://CN=" + txtUser.Text.ToString() + ",OU=Users - Standard Users,DC=mydomain,DC=com,DC=uk", "username", "password"); string sUSN = standardUser.Properties["userPrincipalName"].Value.ToString(); string nastsprofile = (standardUser.Properties["TerminalServicesProfilePath"].Value.ToString()); The bit which gets the userPrincipalName works fine. After that it all goes wrong.

    C# com windows-admin question

  • C# SQL Exception Error
    H hobbsieoz

    I apologise, i realise i put the update command instead of select. However, i get the same problem (nullreferenceexception) if i change the code to the following: oleDbConnection1.Open(); oleDbDataAdapter1.UpdateCommand.CommandText = "UPDATE NASDATA SET EMAIL = 'TESTEMAIL' WHERE ACCOUNT = 'TEST'"; oleDbDataAdapter1.UpdateCommand.ExecuteNonQuery(); oleDbConnection1.Close(); It breaks on the UpdateCommand.CommandText line, saying NullReferenceException was unhandled. Object refernece not set to an instance of an object.

    C# help database csharp design workspace

  • C# SQL Exception Error
    H hobbsieoz

    Hi Im having a problem with SQL and C#. Here is a copy of my code where the problem is occurring. private void button1_Click(object sender, EventArgs e) { oleDbConnection1.Open(); oleDbDataAdapter1.SelectCommand.CommandText = "SELECT * FROM NASDATA where account = 'test'"; oleDbDataAdapter1.UpdateCommand.ExecuteNonQuery(); oleDbConnection1.Close(); } I get an exception error on the ExecuteNonQuery line. NullReferenceException was unhandled. Object refernece not set to an instance of an object. On the design page i have the Oledb connector and dataadapter setup, and the test connection succeeds. Note: I had this same problem using an Access database to. I really hope somebody can help. Many thanks!

    C# help database csharp design workspace

  • Display SQL query results in Windows Form
    H hobbsieoz

    I have tried this method, but did not display my count number results

    C# database question csharp help

  • Display SQL query results in Windows Form
    H hobbsieoz

    This seems very long winded, is there another way.

    C# database question csharp help

  • Display SQL query results in Windows Form
    H hobbsieoz

    Hi im executing a sql command from my C# windows form. Its a count command : SELECT [COLUMN NAME], COUNT(*) FROM [DATABASE] GROUP BY [COLUMN]. 2 Columns load from the results, the column name, and the number of records (count). How can i display these results in a C# windows form? Datagrid, large textbox? Please help me on this.

    Database database question csharp help

  • Display SQL query results in Windows Form
    H hobbsieoz

    Hi im executing a sql command from my C# windows form. Its a count command : SELECT [COLUMN NAME], COUNT(*) FROM [DATABASE] GROUP BY [COLUMN]. 2 Columns load from the results, the column name, and the number of records (count). How can i display these results in a C# windows form? Datagrid, large textbox? Please help me on this.

    C# database question csharp help

  • ToolStripMenuItems from SQL
    H hobbsieoz

    How do i do that

    C# database help question

  • ToolStripMenuItems from SQL
    H hobbsieoz

    Hi, Is there any way i can get a list of items i want added to a ToolStripMenu from SQL. I have a database which contains records that i enter using the application im developing. However, i want to be able to use the SELECT DISTINCT SQL command, to retrieve the names of something from a column, and put it into my toolstrip. Is there any way of doing this? Id be grateful of anybodys help :)

    C# database help question
  • Login

  • Don't have an account? Register

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