Fenrir() 52 Newbie Poster

You have control over what applications are running on your pc (teamviewer etc..) ? so you know they are running meaning that the number of applications you need to close on startup of your application is limited. So you can check your processes and determine if any of those applications are running and close them. And restart them by using this Click Here

Fenrir() 52 Newbie Poster

Click Here

Try this and take it from there.

Fenrir() 52 Newbie Poster

Click Here

You can try something like this

Surendrasinh commented: Thanks for reply.I know it.But i don't know that user will use which program whether he can use TeamViewer or any other Remote Program. +0
Fenrir() 52 Newbie Poster

Here's a simple example that populates the combobox with all the file extensions in your folder.

string[] Files = System.IO.Directory.GetFiles(folder);

foreach (string file in Files)
{
  FileInfo File = new FileInfo(file);

  if (!comboBox1.Items.Contains(File.Extension))
  {
    comboBox1.Items.Add(File.Extension);
  }              
}

You should be able to take it from here.

Fenrir() 52 Newbie Poster

I used a FlowLayoutPanel to accomplish this some time back.

        foreach (KeyValuePair<string, int> pair in dictionary) 
        {
           //Create the picturebox

            PictureBox PicBox = new PictureBox();
            PicBox.Image = Image.FromFile(pair.Key); //Filename          
            PicBox.Dock = DockStyle.Bottom;
            PicBox.SizeMode = PictureBoxSizeMode.Zoom;
            PicBox.Height = 100;
            PicBox.Width = 100;
            flowLayoutPanel1.Controls.Add(PicBox);

        }

Hope this helps

Fenrir() 52 Newbie Poster
using (System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\Logfile.txt", true))
{
  sw.Write("\r\nLog File : ");

  foreach (string file in System.IO.Directory.GetFiles(@"C:\\files"))
  {
    sw.WriteLine("File Name {0}", file);
  }

  sw.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());

 }     

To get the format you need you have to get the file names within the loop and do the additional editing outside the loop.

Output :
Log File :
File Name C:\files\file 1.txt
File Name C:\files\file 2.txt
File Name C:\files\file 3.txt
File Name C:\files\file 4.txt
File Name C:\files\file 5.txt
2:50:20 PM Saturday, September 21, 2013

ddanbe commented: Nice answer +14
Fenrir() 52 Newbie Poster

I have created a method that changes individual rows back color based on certain criteria within the grid. I have noticed that when clicking the column headers that the grid resets the formatted rows. I would like to know what the best solution would be without impacting performance.

Fenrir() 52 Newbie Poster

I agree.. Make sure you're focussed on the correct datagridview. If this is the case just do a simple test by removing the grid on tab 1 and tab 3 and check if it adds to the grid on tab 2. Crude but effective.

Fenrir() 52 Newbie Poster

Seems you copied that directly from your project summary :/

How about actually trying it first then asking for help..

Fenrir() 52 Newbie Poster

I have a screen with a Datagridview. This is linked to a table from my access database. On this screen there are also numerous text boxes that are bound to columns in the table. The problem i am having is that when browsing the grid values seem to vanish and they will only re appear once the application is restarted. I've never had this problem with SQL. Any suggestion as to what may be causing this would be greatly appreciated.

Fenrir() 52 Newbie Poster

You would ideally need to encrypt the password and store it in a constant place. For instance a database. You can even try storing it in the registry.

As for problem 2. What is the code behind the button?

Should be

Application.Terminate

as opposed to

ModalResult := mrCancel;
Fenrir() 52 Newbie Poster

After creating the procedure just Execute it to return everything from "book".

EXEC booklist
Fenrir() 52 Newbie Poster

Maybe something along these lines rather?

SELECT (CASE WHEN COALESCE((EventSummary.[Event Information] - EventSummary.[Event Status]),0) = 0 THEN 'ACTIVE' ELSE (EventSummary.[Event Information] - EventSummary.[Event Status]) END) AS [Event Summary]
Fenrir() 52 Newbie Poster

try this

for (int i = 0; i <= 5; i++)
 {
   textBox1.Text = i.ToString();
   textBox2.Text = TextBox1.Text;
 }
Fenrir() 52 Newbie Poster

Just remember if the image doesn't disappear try

PictureBox.Refesh()
Fenrir() 52 Newbie Poster

I think i misunderstood your question. It will be a very bad idea to have a seperate table for each user. Rather make a general Table and link the user ID to that table. That way you can have multiple users information in one table just like your user table.

Fenrir() 52 Newbie Poster

It's been annoying me ever since i started using SQL.

Check out this link :

http://www.west-wind.com/weblog/posts/2008/Jan/25/An-easier-Table-Design-View-in-Sql-Server-Management-Studio

doesn't seem to be any way to customize the default table designer.

Fenrir() 52 Newbie Poster

Why would they need to update their account everyday? It would be best to use a seperate table yes. Maybe use a UNIQUE Constraint on fields like Email and Username if you aren't doing that already.

Fenrir() 52 Newbie Poster

I don't see why this should fail if your query is as below

SELECT tbl_employee.E_Name,
       SUM(tbl_Salary.Amt) AS [Amount],
       tbl_Dpt.DeptName 
FROM tbl_employee 
INNER JOIN tbl_Salary on tbl_employee.eid = tbl_Salary.eid 
INNER JOIN tbl_Dpt on tbl_Salary.eid = tbl_Dpt.eid 
WHERE tbl_employee.eid ='E101'
GROUP BY tbl_employee.E_Name,
         bl_Dpt.DeptName

if you take out the SUM does it return results?

Fenrir() 52 Newbie Poster

Just open SQL and right click on the "Databases" node in the Object explorer -> New Database. when the new database form pops up simply type a database name and click okay.

Fenrir() 52 Newbie Poster

if (Convert.ToInt(this.LblANDa.Text) == 1)
{
//your code
}

Fenrir() 52 Newbie Poster

Try book_NameListBox.Text

Fenrir() 52 Newbie Poster

Check out this link

http://msdn.microsoft.com/en-us/library/79b3xss3(v=vs.80).aspx

ddanbe commented: Good tip! +8
Fenrir() 52 Newbie Poster

Just type a9 no quotes

Fenrir() 52 Newbie Poster
SqlConnection cn = new SqlConnecton();
cn.ConnectionString = "Data Source=WELL\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True";
string s;
s = textbox1.Text;   ?
string q = "ALTER TABLE abc add '"+textbox1.Text+"' Varchar(20)";
//string q = "ALTER TABLE abc add a8 Varchar(20)";
SqlCommand cmd = new SqlCommand(q, cn);
cn.Open();
cmd.ExcecuteNonQuery();
cn.Close();

Not sure why you were using the reader

Fenrir() 52 Newbie Poster

From what i've read the normal textbox doesn't support links.

http://msdn.microsoft.com/en-us/library/f591a55w.aspx

try this

Fenrir() 52 Newbie Poster

Create labels for the current user. And assign their values from your variables.
in the logout button or form close just run the following sql statement.

SqlCommand cmd = new SqlCommand("Update employee SET logout = "+Datetime.Now+" WHERE Username = "+usernamelbl.text+"")

code not tested.

Fenrir() 52 Newbie Poster

http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx

This should get you started

Fenrir() 52 Newbie Poster

Just write a update statement in the Form close or Logout button to update the current user's information with the current time.