Hi.

i have taken my database from access and my table look like this.

Example. object        description words
ball                     round, big, orange, big
pencil                  long, blue, big, long
ambulance           alert, emergency, high emergency, alert emergency
phone                  incoming message, message alert, high alert, message incoming, emergency, alert

i am doing a search words which for example when i search for big.
Object that contain the word big will appear and thus calculate the number of words big and so how do i eliminate those that i do not want and after that including the wordcount that i have counted.
Finally at the end, sending the result all back to access on a new table.

This is what i did,

          Console.WriteLine(reader.GetValue(1).ToString() + " = " + reader.GetValue(3).ToString());
          string s=reader.GetValue(3).ToString();        
          string[] ss=s.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries);

          int count = 0;
          for (i = 0; i < ss.Length; i++)
          {
              if (ss[i].Equals(searchtext.text))
              {
                  count++;
                                   }
          }
         Console.WriteLine("count : "+count);

so how do i return my database together with the count. Thanks for the help

Recommended Answers

All 7 Replies

You're database design not correct, description words should be in independent table and words also in independent table and there's many-to-many relationship, then you could ask SQL or Access to get what you need in easy manner.

erm. so you mean with what i am doing now, i am unable to accomplish what i want? because i am not very experience or familarise with all this

It's very hard and unscalable. you should do what I said in the first reply.

i am trying but i am quite new in this so i seriously do not know how to start and where to start. Can u roughly tell me my first step?

Create table for words
#ID Word

Create table for descriptions
#ID description

Create bridge table for words\descriptions
#WID #DID

Query them you can get anything you need like
* All words have specific description(s)
* Count of words have specific description(s)
etc...

hi.. you mean i can do everything with the help of access and i do not have to connect to C sharp to do the wordcount?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.