| |

VerySource

 Forgot password?
 Register
Search
View: 2313|Reply: 10

Hastily. Wait online

[Copy link]

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-12-14 18:30:01
| Show all posts |Read mode
I made a program with C#. All functions of this program can be used normally before importing other system data, but after importing 10,000 records, my program can only be added, deleted, and cannot be modified. , The program has no errors and it runs normally. (Mention here, I only use two of the tables for data, and the other tables are also empty tables, and now they cannot be modified. I don't know why), and it doesn't work to clean up the log.
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-12-14 18:45:01
| Show all posts
What is your modification method? Is it a direct SQL statement or a binding method?
What is a database?
Are there any special restrictions in the database?
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-15 02:45:01
| Show all posts
I use sqlserver database
There are no special restrictions in the database.
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-12-15 08:15:01
| Show all posts
Post part of your program to modify the database, so you can't see what's wrong.
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-12-15 09:30:01
| Show all posts
Post the core code, it is difficult to diagnose
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-15 12:45:01
| Show all posts
Class code:

        private void UpdateRecord()
        {
            try
            {
               // myDataSet.Tables["Info_List"].Rows[iCurrentRow]["Info_Id"] = base.Info_Id;
                myDataSet.Tables["Info_List"].Rows[iCurrentRow]["Info_Title"] = base.Info_Title;
                myDataSet.Tables["Info_List"].Rows[iCurrentRow]["Info_Body"] = base.Info_Body;
                if(base.Info_Date!="")
                 {
                     myDataSet.Tables["Info_List"].Rows[iCurrentRow]["Info_Date"]=Convert.ToDateTime(base.Info_Date);
                  }
                if(base.End_Date!="")
                 {
                     myDataSet.Tables["Info_List"].Rows[iCurrentRow]["End_Date"]=Convert.ToDateTime(base.End_Date);
                  }
                myDataSet.Tables["Info_List"].Rows[iCurrentRow]["uid"] = base.uid;
                myDataSet.Tables["Info_List"].Rows[iCurrentRow]["Info_Class"] = base.Info_Class;
                mySqlDataAdapter.Update(myDataSet,"Info_List");
            }

            catch
            {
            }
        }


        public void Save()
        {
            if (bIsDirty==true)
            {
                UpdateRecord();
                bIsDirty=false;
            }
        }


cs file code

CInfo_Lists m_Info_List=new CInfo_Lists();
m_Info_List.bIsDirty=true;
m_Info_List.Save ();
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-15 13:00:01
| Show all posts
Everything is normal before the data is poured, and it is normal if the database is newly created.
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-12-18 08:00:02
| Show all posts
Remove
try
{
... ...
}
catch
            {
            }
It will report an error. You will ignore any errors in this exception handling.
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-12-18 08:30:01
| Show all posts
It may be an abnormal time conversion, or an abnormality in updating the database.
Knowing what is the exception can be dealt with in a targeted manner
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-12-18 18:45:02
| Show all posts
The prompt is as follows:

Dynamic SQL generation of UPdateCommand is not supported for the Select Command value that does not return any key column information
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list