|
oh I could pass this test! (Wait, I did ACE this test)
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I am not doing a test you moron. just want to know thats all.
|
|
|
|
|
uglyeyes wrote: you moron
Yeah, that'll get your questions answered...
BTW, your post DOES look like a take-home test, or at the very least, a homework assignment. I think you'll have to do your own work for this one...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: Yeah, that'll get your questions answered...
uglyeyes should heed my sig...
I'd like to help but I don't feel like Googling it for you.
|
|
|
|
|
The difference between genius and idiot is public preception. I am often critisized by the dumb masses so I will take the better of the two.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi
Has anyone made a tab control transparent?
Basically what I'm trying to do is only draw the tabs and not the background for the tab control. Is it possible?
Thanks
Limey
|
|
|
|
|
I have created a File Watcher program. This has on event which is raised when a file is added to a folder. I want to receive a message or a hint that file transer to that folder is complete. I get the message at the begging of the file transfer that is when file starts droping to that folder. How can I achieve that at the end of file transfer I get the message ?
I am trying to use follwoing eventhandler, but it does not tell me when File trnasfer is complete.
private void FileAdded(object source, Utils.FileWatcherEventArgs e)
{
try
{
string path = "c:\\Temp\\xyz.txt";
if (File.Exists(path))
{
using (StreamReader sr = new StreamReader(path))
{
sr.BaseStream.Seek(0, SeekOrigin.End
if(sr.Peek()!= -1)
{
MessageBox.Show("File Transfer Complete");
}
}
}
}
catch(Exception ex)
{
Console.WriteLine("The process failed: {0}", ex.ToString());
}
}
In life, failures teach you as much as — or perhaps more than — successes.
Thank you very much for the help.
Bharat.
|
|
|
|
|
There's no such event. The accepted method is to keep trying to open the file with exclusive access, denying Shared Read and Write access to the file. If you can open it, chances are the file is done being written to, but NOT in all cases! It depends on the process that's writing the file. If you can't open it, wait a little while and try again.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I was able to print the document using PrintDocument.
I was trying to preview the document using the PrintPreviewControl.
I was display one page using PrintPreviewControl.
Is there a way to display multiple pages using PrintPreviewControl
if so how
Thanks
kal
|
|
|
|
|
hello. I have downloaded sample code from microsoft, and under the Project Properties --> Additional Dependencies, they have "$MSSdk"\Include. I know that "$MSSdk" is a variable, but I'm not sure where/how to define it as the path to the Microsoft SDK I have installed. My question is, how would I do so?
I love to program!
|
|
|
|
|
If you install the platform SDK, this should take care of itself. Perhaps even the SDK that comes with the IDE maps to this. Why do you think there's a problem ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The samples provided with the SDK won't compile. I ran the program that the ReleaseNotes.Htm file said to run and it said the environment variables were set, but the samples still won't compile. If I keep them in the same directory I don't have write access, and if I move them to another directory, it can't find anything.
I love to program!
|
|
|
|
|
allenmpcx wrote: The samples provided with the SDK won't compile.
What happens ? What errors do you get ?
allenmpcx wrote: If I keep them in the same directory I don't have write access
Then change the file properties so you do.
You could also replace the settings with absolute paths if you wanted to
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks a lot! I got it to work with msbuild *project_name.sln* and it worked. Thanks a lot again.
I love to program!
|
|
|
|
|
Hi all,
I go to control pannel to crate DSN everytime I want to create new one. But I'm trying to create the new DSN for "MySQL ODBC 3.51 Driver" programmatically. I am making research and find alot but neither one is giving me the answer to my question. Maybe I dont' really understand how to work.
Thanks for your help
|
|
|
|
|
|
In Visual Basic, their was an option to add a watch, and also break when the value of a variable changes. If their a similar option available to c# users in VS2005? I have been unable to find any information on this.
Thanks in advance.
|
|
|
|
|
Set the break point then right click and select "Condition" in the popup menu.
In the dialog select the "has changed" radio and type in the variable in the edit box.
led mike
|
|
|
|
|
You can set a breakpoint and have it fire only when a value changes, but that line of code needs to be executed, there's no option to break where-ever a value is changed that I know of.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Using VS2003 DataGrid who can help me set forecolors for individual columns and/or rows? I've looked thru the properties of System.Windows.Forms.DataGridTableStyle() and cannot find anything column / row / cell specfic. In the article by Pete2004 posted on the Code Project ("A Practical Guide to .NET DataTables ...") he uses a DataGrid.Items.Cells..... But in VS2003 I cannot access this property.
Please help. Thx.
|
|
|
|
|
use
dataGridView1.Rows[1].Cells[1].Style.BackColor = Color.Black
dataGridView1.Rows[1].Cells[1].Style.ForeColor = Color.Black
Thanks
Kal
|
|
|
|
|
okay, need more help. I'm working with a WinForms control, not web. Your code is vague to me, I don't see a datagridview, but there is a DataView. However that doesn't control column / row / cell color.
For a WinForm control how can I control column / row / cell colors?
Thanks.
|
|
|
|
|
I'm having trouble figuring out just how I should best approach this.
I have a simple form to edit users
Search fields
DataGridView(view only, no editing)
Edit fields
What I have set up is that when the search is run, 2 datatables are created....1 with slimmed down columns and usable column aliases to be displayed in the datagridview "grid view table", and another that has all columns and data "bulk data table". Both have the same WHERE statements, just different SELECTed columns.
When the enduser clicks on a row in the grid view, the index is pulled from the grid view and used to create a user object from the "bulk data table" which in turn fills all my edit fields with that user's information.
I got this all working correctly until I realized that I could not turn off sorting by header in the grid view, which in turn throws off my indexes to the "bulk data".
I would love for them to be able to sort by the columns, but not at the expense of my whole form not working.
Please let me know if you have any recommendations.
Below is my partial class for the form.
Some of the comments are things I have tried. Below, I was trying to use views to no avail.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace PSTMGR
{
public partial class AdminControl : UserControl
{
IniReader INI;
DataTable dataTable;
DataView dataView;
DataRow dataRow;
UserObj currentUser;
public AdminControl()
{
InitializeComponent();
INI = new IniReader(Application.StartupPath + "\\PSTMGR.INI");
this.DBPath.Text = INI.ReadString("DBInfo","DBPath", "");
}
private void changeDBPath_Click(object sender, EventArgs e)
{
OFD = InitOFD(null);
DialogResult dr = OFD.ShowDialog(this);
if (dr != DialogResult.OK)
return;
string fn = OFD.FileName;
this.DBPath.Text = fn;
INI.Write("DBInfo", "DBPath", fn);
}
private OpenFileDialog InitOFD(OpenFileDialog o)
{
if (o != null)
return o;
o = new OpenFileDialog();
o.InitialDirectory = "C:\\";
o.Title = "Load Image File";
o.CheckPathExists = true;
o.CheckFileExists = true;
o.Filter = "Access DB(*.MDB)"
+ "|*.MDB";
return o;
}
private void searchUsers_Click(object sender, EventArgs e)
{
bool first = true;
String dataQuery = "SELECT * FROM USERS";
if (searchUserName.Text.Length != 0)
{
first = false;
dataQuery += " WHERE USER_NAME = '" + searchUserName.Text + "'";
}
if (searchFirstName.Text.Length != 0)
{
if (first)
{
first = false;
dataQuery += " WHERE";
}
else
{
dataQuery += " AND";
}
dataQuery += " FIRST_NAME = '" + searchFirstName.Text + "'";
}
if (searchLastName.Text.Length != 0)
{
if (first)
{
first = false;
dataQuery += " WHERE";
}
else
{
dataQuery += " AND";
}
dataQuery += " LAST_NAME = '" + searchLastName.Text + "'";
}
dataTable = PSTMGRApp.Connection.Query(dataQuery);
dataView = new DataView(dataTable);
this.adminResults.DataSource = dataView;
fillDataFields();
}
private void adminResults_CellClick(object sender, DataGridViewCellEventArgs e)
{
fillDataFields();
}
private void fillDataFields()
{
if (dataTable.Rows.Count != 0)
{
dataRow = dataTable.Rows[adminResults.CurrentRow.Index];
currentUser = new UserObj(Convert.ToInt32(dataRow["USER_ID"].ToString()),
dataRow["USER_NAME"].ToString(),
dataRow["PASSWORD"].ToString(),
dataRow["FIRST_NAME"].ToString(),
dataRow["LAST_NAME"].ToString(),
Convert.ToBoolean(dataRow["ADMIN_PRIV"]),
Convert.ToBoolean(dataRow["ADD_PRIV"]),
Convert.ToBoolean(dataRow["EDIT_PRIV"]),
Convert.ToBoolean(dataRow["DELETE_PRIV"]));
userName.Text = currentUser.UserName;
passWord.Text = currentUser.Password;
firstName.Text = currentUser.FirstName;
lastName.Text = currentUser.LastName;
adminCheck.Checked = currentUser.Admin;
addCheck.Checked = currentUser.Add;
editCheck.Checked = currentUser.Edit;
deleteCheck.Checked = currentUser.Delete;
}
else
{
currentUser = new UserObj();
userName.Text = null;
passWord.Text = null;
firstName.Text = null;
lastName.Text = null;
adminCheck.Checked = false;
addCheck.Checked = false;
editCheck.Checked = false;
deleteCheck.Checked = false;
}
}
private void clearUsers_Click(object sender, EventArgs e)
{
searchUserName.Text = null;
searchFirstName.Text = null;
searchLastName.Text = null;
}
private void adminResults_Sorted(object sender, EventArgs e)
{
String column = adminResults.SortedColumn.Name.ToString().Trim();
String order = adminResults.SortOrder.ToString().Trim();
MessageBox.Show(column);
MessageBox.Show(order);
switch (column)
{
case "First Name" :
if (order.Equals("Ascending"))
dataView.Sort = "FIRST_NAME ASC";
else if (order.Equals("Descending"))
dataView.Sort = "FIRST_NAME DESC";
break;
case "Last Name" :
if (order.Equals("Ascending"))
dataView.Sort = "LAST_NAME ASC";
else if (order.Equals("Descending"))
dataView.Sort = "LAST_NAME DESC";
break;
case "Username" :
if (order.Equals("Ascending"))
dataView.Sort = "USER_NAME ASC";
else if (order.Equals("Descending"))
dataView.Sort = "USER_NAME DESC";
break;
case "Password" :
if (order.Equals("Ascending"))
dataView.Sort = "PASSWORD ASC";
else if (order.Equals("Descending"))
dataView.Sort = "PASSWORD DESC";
dataTable.DefaultView.Sort = "[PASSWORD]";
break;
}
}
}
}
Michael
-- modified at 1:23 Friday 11th August, 2006
|
|
|
|
|
Don't use the row index to obtain a row from a related table, use a foreign key relationship.
led mike
|
|
|
|
|
Thanks Mike....that makes total sense now. Am I going about this the best way, or is there a better method I should follow? Having two datatables hits the database twice(detached, doesn't lock data), so would it be better to just hit the database for the bulk table, then create a dataview from that and use it for the grid view? Would that decrease overhead or would it even be noticable?
I'm a bit new to c# and ado, so any input is appreciated.
Michael
|
|
|
|