Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 22nd, 2005, 11:55 PM   #1
Samsonite
Newbie
 
Samsonite's Avatar
 
Join Date: Mar 2005
Posts: 15
Rep Power: 0 Samsonite is on a distinguished road
Search Engine

Hey guys i am very n00b at c# at the moment but i am currently in the process of creating a C# program for a school assignment. In this assingment the program must be able to connect to a database then search through what even information i put in it. i am asking you guys if you have done this before? Creating the search engine or know of tutorials i can go to and ave a look please because i am really confused.
Samsonite is offline   Reply With Quote
Old Mar 23rd, 2005, 9:23 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Have you been able to connect to the database? Cause after that it's just a matter of some sql.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Mar 24th, 2005, 9:49 PM   #3
new User(Kevin.Parkinson)
Programmer
 
new User(Kevin.Parkinson)'s Avatar
 
Join Date: Mar 2005
Location: Edmonton, Alberta, Canada
Posts: 37
Rep Power: 0 new User(Kevin.Parkinson) is on a distinguished road
Send a message via MSN to new User(Kevin.Parkinson)
C# & ASP.NET is exciting!

Samsonite:

Sounds like a very interesting assignment...one that can be developed more and more as you go on. I agree with Pizentios, that once you get connected it's just a matter of being clever with some SQL algorythyms. Myself, I would try implementing Web Services in some way as well, but that's just me, and may not be part of your assignment.

Are you having any difficulty with any particular part of the App?

Where do you go to school? I am currently attending NAIT( The Northern Alberta Institute Of Technology ) in Edmonton, Alberta, Canada, and I am enjoying it.

Sincerely,
Kevin Parkinson

Last edited by new User(Kevin.Parkinson); Mar 24th, 2005 at 9:52 PM. Reason: Misspelled words, and I like to format
new User(Kevin.Parkinson) is offline   Reply With Quote
Old Mar 25th, 2005, 12:01 AM   #4
Samsonite
Newbie
 
Samsonite's Avatar
 
Join Date: Mar 2005
Posts: 15
Rep Power: 0 Samsonite is on a distinguished road
i am in high school grade 12 at the moment and i cant get it to work... i have to create the program in Microsoft visual studios .net 2003 any tutorials or examples would really help please send to samsonite87@gmail.com
thankyou

sam moohin
Samsonite is offline   Reply With Quote
Old Mar 28th, 2005, 9:02 AM   #5
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
try posting some code, some us might be able to give you some pointers.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Apr 1st, 2005, 12:01 AM   #6
Samsonite
Newbie
 
Samsonite's Avatar
 
Join Date: Mar 2005
Posts: 15
Rep Power: 0 Samsonite is on a distinguished road
thats the thing i dont know where to start!
like i dont even know what sql command to use to search through the database finding each item that starts with M ete becasue the data base consists of 3 tables, 1, moVIES, 2. Games and 3 Music and database is claled assignment

ive been findeling around with iht but im still not getting anywhere
Samsonite is offline   Reply With Quote
Old Apr 1st, 2005, 1:30 AM   #7
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
Ask your tutors and read the books and notes you should have from your classes then try some code then get back to us and we will help.
Berto is offline   Reply With Quote
Old Apr 1st, 2005, 8:50 AM   #8
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
here's some sql that i would use.

SELECT * FROM movies WHERE item LIKE 'M%'

then if you wanted to automate the deal, just have a array with the three table names in it. Then put a for loop around it. then replace the table with the varible.

so something like this:

//var declair
string sql;
string[] tables = new string[2];
tables[0] = "movies";
tables[1] = "games";
tables[2] = "music";
//now we need the for loop:
for (int x=1; x<2; x++)
         //now to build the sql string
         sql = "SELECT * FROM " << tables[x] << " WHERE item LIKE 'M%'";
         //then do your select here, i would use another array to hold the results from each     select statment.


//then display the search results here.

did that help you get started?
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Apr 1st, 2005, 9:52 AM   #9
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
code to connect to a MySQL database via ByteFX and C#

 using System;
 using System.Data;
 using ByteFX.Data.MySqlClient;

 public class Test
 {
    public static void Main(string[] args)
    {
       string connectionString =
          "Server=SERVERNAME.com;" +
          "Database=DBNAME;" +
          "User ID=USERID;" +
          "Password=PASSWORD;";
       IDbConnection dbcon;
       dbcon = new MySqlConnection(connectionString);
       dbcon.Open();
       IDbCommand dbcmd = dbcon.CreateCommand();

       string sql =
           "SELECT firstname, lastname " +
           "FROM test";
       dbcmd.CommandText = sql;
       IDataReader reader = dbcmd.ExecuteReader();
       while(reader.Read()) {
            string FirstName = (string) reader["firstname"];
            string LastName = (string) reader["lastname"];
            Console.WriteLine("Name: " +
                  FirstName + " " + LastName);
       }
       // clean up
       reader.Close();
       reader = null;
       dbcmd.Dispose();
       dbcmd = null;
       dbcon.Close();
       dbcon = null;
    }
 }
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Apr 3rd, 2005, 4:07 AM   #10
Samsonite
Newbie
 
Samsonite's Avatar
 
Join Date: Mar 2005
Posts: 15
Rep Power: 0 Samsonite is on a distinguished road
Okay thanx guys that has really helped ill go muck around with it now
ill host it up later on when i get stuck (prolly soon ) thanx very much
Samsonite is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC