Ramy Mahrous 401 Postaholic Featured Poster

First solution came is to group them inside UserControl, and play with them like above.

Ramy Mahrous 401 Postaholic Featured Poster

1- The work and the privilage you need to operate on file system is much harder with lots of exceptions.
2- In many cases there no images on HDD, all manipulated from database directly.

Conclusion... both solutions right and correct.

Ramy Mahrous 401 Postaholic Featured Poster

In many many many cases you have to save it as image not only the path.. In case users may change\delete images and you depend on them.

Ramy Mahrous 401 Postaholic Featured Poster

You're not replicate to take care about auto increment indexes... did you try backup and restore then faced any problem?!
If you ask about how to backup it... you can build SSIS package to backup the database with any logic and create job to execute this package.

Ramy Mahrous 401 Postaholic Featured Poster

new it like counts = new int[100000]; time to initialize it by for loop 430024
time to initialize it by new 10001

Ramy Mahrous 401 Postaholic Featured Poster

Look you can't do that... unless you may run a service to open all files so user can't open\copy or do any operations on those files (I don't recommend it)
You may save images as binary so user can't access it, but still any operations applicable on them.

Ramy Mahrous 401 Postaholic Featured Poster

Why counts[i] = 0; it's initialized by default.
and this too c1[i, j] = 0;

Ramy Mahrous 401 Postaholic Featured Poster

Again can't get exactly what you meant! do you mean log actions done by or on objects?

Ramy Mahrous 401 Postaholic Featured Poster

I don't get what you need us to help in?

Ramy Mahrous 401 Postaholic Featured Poster

You don't need C# right now, just concerntate on datbase design and concepts read more about database normalization and how to make your desing more efficient. I don't have specific resources use Google\Bing you'll read posts about each topic.

Ramy Mahrous 401 Postaholic Featured Poster

Using SMO library you can modify your database objects, here's a sample http://www.codeproject.com/Tips/43900/Creating-SQL-Server-Login-programmatically.aspx but to do something a bit different but I'm sure you'll get it.

I believe there's something in your design to avoid redesign everytime, be sure your system is scalable enough and try another database design.

Ramy Mahrous 401 Postaholic Featured Poster

I believe ASP.NET forum is better for such questions http://www.daniweb.com/forums/forum18.html

Ramy Mahrous 401 Postaholic Featured Poster
ddanbe commented: Good tip Ramy :) +7
Ramy Mahrous 401 Postaholic Featured Poster

Change email.Body to email.Body = "<body background=\"@@IMAGE@@\"> </body>"

Ramy Mahrous 401 Postaholic Featured Poster

Does this T-SQL script work? inner joins\nestes queries make you get fields from multiple tables, did you try it?
Please tell me what you want to get from the tables? I think it AdventureWorks database, isn't it?

Ramy Mahrous 401 Postaholic Featured Poster

You can use "using" or fullnaming methodology Namespace.NestedNamespace.ClassName

using Microsoft.Office.Interop.Outlook;

Sample http://www.codeguru.com/csharp/csharp/cs_syntax/operators/article.php/c14293/Microsoft-Outlook-Integration-with-CNET.htm

Ramy Mahrous 401 Postaholic Featured Poster

First I recommend to ask this question in ASP.NET forum http://www.daniweb.com/forums/forum18.html
Second Why to retrive the 7000 records? those records a result for something? search result of example? if yes you should get them 10 by 10 or X by X where X < 100
Session in your case is pure abuse for what it should be used in :)

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

We don't hear anything from them.

Ramy Mahrous 401 Postaholic Featured Poster

If it helps, please share your code with us as answer here or as code snippet and remark this thread as solved.

Ramy Mahrous 401 Postaholic Featured Poster

So?!

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Sorry, but what's the expected response? give me input\output to figure it out. or read http://fci-h.blogspot.com/2010/05/how-to-consum-rest-based-services.html and configure it to work on simple web request.

Ramy Mahrous 401 Postaholic Featured Poster

Move your mouse on ExecuteScalar and see what the tooltip shows.

Ramy Mahrous 401 Postaholic Featured Poster

OK! As you like...
This code untested please adjust your variables to fit your case.

private const string CONNECTION_STRING =
            @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=[access database file path];Persist Security Info=False;";

        public bool CheckValidUser(string username, string password)
        {
            OleDbConnection dbConnection = new OleDbConnection(CONNECTION_STRING);
            
            string commandString = 
            "select count(*) from users where username = @username and password = @password";
            
            OleDbCommand commandStatement = new OleDbCommand(commandString, dbConnection);
            
            commandStatement.Parameters.Add("@username", OleDbType.VarWChar).Value = username;
            commandStatement.Parameters.Add("@password", OleDbType.VarWChar).Value = password;
            
            dbConnection.Open();
            int x = (int)commandStatement.ExecuteScalar();
return true ? x > 0 : false;
        }
Ramy Mahrous 401 Postaholic Featured Poster

Buddy! If I showed you some codes you'd drop million of questions! here we don't say how to develop an application, here we help if you face some problem, as because you're not familiar with ADO.NET anything answered here is valueless!!

Ramy Mahrous 401 Postaholic Featured Poster

Does reader.HasRows = false ?

Ramy Mahrous 401 Postaholic Featured Poster

I don't know :) but do you see there's row selected to be edited? or when you leave the grid it unselect all selected rows to be changed?! I really don't know your scenario, but the debugger very helpful guy in such situations.

Ramy Mahrous 401 Postaholic Featured Poster

What :)

Ramy Mahrous 401 Postaholic Featured Poster

While debugging check the count of form.dataGridView2.SelectedRows I'm sure it equals -1

Ramy Mahrous 401 Postaholic Featured Poster

replace if (LinkLabel.Equals("linkLabel1")) with

if (LinkLabel.Text("linkLabel1"))
Ramy Mahrous 401 Postaholic Featured Poster

Because there is not selected rows! is it?

Ramy Mahrous 401 Postaholic Featured Poster

Start over! did you try my piece of code? if you yes then tell me what's wrong else kindly check it.

Ramy Mahrous 401 Postaholic Featured Poster

Simply... implement the event handler for the LinkButton, Double click on your LinkButton. VS will switch you to code view inside this method

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
//here to write your code 
LinkLabel link = (LinkLabel)sender;
            if (LinkLabel.Equals("linkLabel1"))
            {
                SqlDataAdapter dtadp = new SqlDataAdapter();
                DataTable dtbl = new DataTable();

                SqlConnection cn = new SqlConnection(@"Server=208.124.179.197;Database=RTLUser;UID=sa;");
                cn.Open();
                DataSet data = new DataSet();
                string myString = "";
                myString = @"Select distinct word from wordTbl where word like 'a%'";
                SqlCommand cmd = new SqlCommand(myString, cn);

                SqlDataReader rdr = cmd.ExecuteReader();
                cn.Close();
                dtadp.SelectCommand = cmd;
                dtadp.Fill(dtbl);
                dataGridView2.DataSource = dtbl;
            }
            else
            {


               dateTimePicker1.Visible = true;
               SqlDataAdapter dtadp = new SqlDataAdapter();
               DataTable dtbl = new DataTable();

               SqlConnection cn = new SqlConnection(@"Server=208.124.179.197;Database=RTLUser;UID=sa;");
               cn.Open();
               DataSet data = new DataSet();
               string myString = "";
               myString = @"Select distinct word from wordTbl";
               SqlCommand cmd = new SqlCommand(myString, cn);

               SqlDataReader rdr = cmd.ExecuteReader();
               cn.Close();
               dtadp.SelectCommand = cmd;
               dtadp.Fill(dtbl);
               dataGridView2.DataSource = dtbl;
           }
        }
Ramy Mahrous 401 Postaholic Featured Poster

Then you've to read in Introduction to OLE DB http://www.functionx.com/vbnet/oledb/Lesson01.htm

Ramy Mahrous 401 Postaholic Featured Poster

You use Insert command and need to Pull data?! How come?!
Can you please tell me after changing SqlDbType what errors raised.

Ramy Mahrous 401 Postaholic Featured Poster

Reasonable! You handle the Click event of Button then cast it as LinkLabel! Use another event handler for the Click of LinkLabel.

Ramy Mahrous 401 Postaholic Featured Poster

Danny, you don't imagine how much I miss you... Welcome back...
I love Arabic, that's why I did this as code snippet to help who want to deal with it, and for sure I'll be happy to find lots of questions about it.
"salaam" or "salam" == greeting words == "Hey, Hello, or bye bye" the origin "Al Salam" == some name of Allah -our God in Islam-
"Salaam" said instead of "Al Salam Alikom" == Peace be upon you.

What I wrote in the TextBox == I love Arabic language :)

Ramy Mahrous 401 Postaholic Featured Poster

Give me your code :) with just exceptions I can't assume what did you write.

Ramy Mahrous 401 Postaholic Featured Poster

It's another question, isn't it? please if thread question answered mark it as solved and open another thread.
Consistency Required :)

Ramy Mahrous 401 Postaholic Featured Poster

1- Handler TextBox Key pressed event handler.

ddanbe commented: Hi Ramy! Nice snippet :) +6
Ramy Mahrous 401 Postaholic Featured Poster

That's the code when you click on the button -when you assign button_Click method to its Click event handler-

void button_Click(object sender, EventArgs e)
{
//here change the properties of the LinkedButton...
}
Ramy Mahrous 401 Postaholic Featured Poster

Buddy, It's a business scenario! what the technical problem you face?!

Ramy Mahrous 401 Postaholic Featured Poster

SqlDbType :)

Ramy Mahrous 401 Postaholic Featured Poster

I didn't get it! can you please clarify!
If you want to handle two buttons click in one handler you set the event handler for each of which by its properties window to button_Click method.

void button_Click(object sender, EventArgs e)
{
Button clickedButton = (Button)sender;
if(clickedButton.Name == "Button1")
{
MessageBox.Show("Button 1 Clicked");
/// some operations 
}
else if(clickedButton.Name == "Button2")
{
MessageBox.Show("Button 2 Clicked");
/// some operations 
}
}
Ramy Mahrous 401 Postaholic Featured Poster
SELECT words FROM TableWords WHERE date = @date
SqlConnection dbConnection = new SqlConnection(CONNECTION_STRING);
string commandString = 
            "SELECT words FROM TableWords WHERE date = @date";
             SqlCommand commandStatement = new SqlCommand(commandString, dbConnection);
            commandStatement.Parameters.Add("@date", SqlType.SmallDatetime).Value = DateTimePicker1.Value;
DataReader results = commandStatement.ExecuteReader();
....
Ramy Mahrous 401 Postaholic Featured Poster
//Global Variables
Form frmChild;

private void button1_Click(....)
{
//show child form
frmChild=new Form();
frmChild.MDIParent=this;
frmChild.Show();
frmChild.FormClosed+=new FormClosedEventHandler(frmChild_FormClosed);
//disable your button
button1.Enabled = false;
}

void frmChild_FormClosed(object sender, EventArgs e)
{
button1.Enabled = true;
}
Ramy Mahrous 401 Postaholic Featured Poster

Look... You should write the query to have the question answer.
SELECT Question, ...., Answer, then you set the navigation property of the Dynamic Link created to the [Answer] column returned -Here I suppose you're using DataGridView- if you tell me how the database looks like, definitely I'll help you better.

Ramy Mahrous 401 Postaholic Featured Poster

Please clarify, where the button is? Parent Form or the Child one? and tell me the exact scenario.

Ramy Mahrous 401 Postaholic Featured Poster

CellBeginEdit

private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
MessageBox.Show("User began editing the cell");
}