Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8758219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:29:20+00:00 2026-06-13T14:29:20+00:00

Uhmm well .. i have a local DB .. created using VS 2012 ..

  • 0

Uhmm well .. i have a local DB .. created using VS 2012 .. not the LocalDB .. its SqlExpress x64 ..

i have a C# program that reads and parses a txt file .. and converts the data into records .. and around 200,000 records are inserted in one flow of execution .. the program parses and creates a insert query and executes it ..

i have used Sql objects .. SqlCommand .. SqlConnection ….. for insertion ..

the problem is that the console C# application does show that all records are inserted successfully till last count ..

but i can see only 1000 records in DB Table ..

Code to insert:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.IO;

namespace SentiWordDBPopulate
{
class DBPopulateSentiWord
{
    static SqlCommand sqlCmd;
    static SqlConnection sqlConn;

    static void Main(string[] args)
    {
        try
        {
            sqlConn = new SqlConnection("server=localhost\\SqlExpress; DataBase=WordDBForBlogMiner; integrated security=true");
            sqlConn.Open();
            //sqlCmd = new SqlCommand("select * from KWTable", sqlConn);

            //skip 1st 13 lines
            //for (int i = 1; i <= 13; i++)
            //fin.ReadLine();

            string[] lines = File.ReadAllLines("C:\\Users\\Ritesh\\Desktop\\WordDB.txt");

            Console.WriteLine("Done reading! Press enter to insert everything into DB.");
            Console.Read();

            long IDCounter = 0;
            //enter next 117658 lines into DB
            for (int i = 13; i < lines.Length; i++)
            {
                //string line =fin.ReadLine();
                string[] s = (lines[i].Remove(lines[i].IndexOf('#')).Split(new char[] { '\t' }, StringSplitOptions.RemoveEmptyEntries));
                //s[5] = s[6] = null;
                s[2] = s[2].Equals("NaN") ? "0" : s[2];
                s[3] = s[3].Equals("NaN") ? "0" : s[3];
                float tempNegScore = float.Parse(s[3]), tempPosScore = float.Parse(s[2]);
                int negScore = (int)Math.Round((tempNegScore * 27), MidpointRounding.AwayFromZero);
                int posScore = (int)Math.Round((tempPosScore * 31), MidpointRounding.AwayFromZero);

                if (posScore <= 31 && negScore <= 27)
                {
                    //Console.WriteLine((++IDCounter) + "\t => " + s[0] + "\t" + posScore + "\t" + negScore + "\t" + s[4]);
                    string category = "";
                    if (posScore.Equals(0) && negScore.Equals(0))
                        category = "neutral";
                    else if (posScore > 0 && negScore.Equals(0))
                        category = "positive";
                    else if (posScore.Equals(0) && negScore > 0)
                        category = "negative";
                    else if (posScore > 0 && negScore > 0)
                        category = "PosNeg";

                    string query = "insert into SentiWordKWTable values ('" + s[0] + "', " + (++IDCounter) + ", " + posScore + ", " + negScore + ", '" + s[4].Replace("'", "") + "', '" + category + "')";
                    sqlCmd = new SqlCommand(query, sqlConn);
                    sqlCmd.ExecuteNonQuery();
                    Console.WriteLine("Record Num: " + IDCounter + " successfully inserted!");
                }
                else
                {
                    Console.WriteLine((++IDCounter) + "\t => " + s[0] + "\t" + posScore + "\t" + negScore + "\t" + s[4]);
                    break;
                }

                tempNegScore = tempPosScore = 0;
                posScore = negScore = 0;
            }
            Console.Read();
        }
        catch (Exception e)
        {
            Console.WriteLine("Exception occured => " + e.Message);
            sqlCmd = new SqlCommand("delete from SentiWordKWTable", sqlConn);
            sqlCmd.ExecuteNonQuery();
            Console.WriteLine("all rows of table deleted");
        }
        Console.Read();
    }
}

}

it was not a problem earlier in VS 2008 .. is there some restriction in VS 2012 .. or something to enable for >1000 insertion? ..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:29:21+00:00Added an answer on June 13, 2026 at 2:29 pm

    It’s the visibility option only. There is a small toolbar at top which has a field: Max Rows: 1000
    I selected “All” in that and everything is visible … * facepalm *

    Sorry for trouble everybody, and thanks @MarcGravell I’ll use parameters instead of concatenation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to the show the previous statement in the method that I'm
I have a folder in my SD Card as: /mnt/sdcard/Folder1/Folder2/Folder3/*.jpg The name of Folder1
I hope this question isn't too simple, I tried to go through the postgresql
Assume someClass is a class defined in C# with some method int doSomething(void) ,
How can I actually use delimeter in java, this is the example data.dat file
I'm implementing a custom control and in this control I need to write a
I'm doing a unit called Data Structures and Algorithms. We've just started and my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.