So, you have Child Form which opens from the button... you'll implement the event Form Closed of the Child Form to execute this piece of code
yourButton.Enabled = true;
So, you have Child Form which opens from the button... you'll implement the event Form Closed of the Child Form to execute this piece of code
yourButton.Enabled = true;
Sorry! but is it in Windows application or web-based application? If you want to convert it to array of bytes so...
System.Drawing.Image img;
....//any operation on img instance
....//any operation on img instance
....//any operation on img instance
System.IO.FileStream fs = new System.IO.FileStream(imagePath, System.IO.FileMode.Open);
img.Save(fs);
byte[] imageAsBytes = new byte[fs.Length];
fs.Read(imageAsBytes, 0, imageAsBytes.Length);
fs.Close();
//imgaeAsBytes is array of Byte to your image
Work with MemoryStream it may help to separate your operations and the physical file.
Reasonable! :) should have typical copy on temp folder and work on it, if your operation successed then you delete the original one.
System.IO.File.Delete(FilePath);
Handle Keypressed event of the textbox
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
char lastChar = e.KeyChar;
//MessageBox.Show(((int)e.KeyChar).ToString());
if (e.KeyChar != 32 && e.KeyChar !=8) //allows space and backspace
{
if (char.IsControl(lastChar) || char.IsDigit(lastChar) || char.IsNumber(lastChar) || char.IsPunctuation(lastChar))
e.Handled = true;
else if (lastChar < 1575)//the start of ascii codes for Arabic chars.
e.Handled = true;
}
}
Don't give generic answers :) all BI features not exist in Standard edition :) http://www.microsoft.com/sqlserver/2005/en/us/compare-features.aspx#busintell
Nothing more consistency... ensure that your shared object if exists is consistant by i.e using Lock
Can you replace
Thread th = new Thread(DoWrok);
th.Start(strList);
by
ThreadStart thrdStrt = new ThreadStart(methodName); //void method without parameters
Thread th = new Thread(thrdStrt);
th.Start(params...);
Please debug your code to know where the problem is.
Paul... I didn't get where you stuck.. but if you need tutorial guide I recommend this http://functionx.com/adonet/index.htm
What type of database are you using?
Thread name SQL in C# :)
I got yesterday a question how to get average date from list of dates, and here's my answer.
Give me your connection string
Trust me, it works :) please mark it as solved.
created column index (delete button)
Post what you don't understand...
First create delete button in the grid
//I prefer to use the wizard to generate the delete button
private System.Windows.Forms.DataGridViewButtonColumn Column1;
this.Column1.HeaderText = "delete";
this.Column1.Name = "Column1";
this.Column1.Text = "delete";
this.Column1.UseColumnTextForButtonValue = true;
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.ColumnIndex == 4)// created column index (delete button)
{
dataGridView1.Rows.Remove(dataGridView1.Rows[e.RowIndex]);
//commit the changes!
}
}
Copy the code!! or make it reusable control and drag it and drop it wherever.
So, Daniweb administrative stuff can you please respond!
Because of spaces man...
public void WriteDataToFile(MeetingEntry currentEntry)
{
OleDbConnection dbConnection = new OleDbConnection(CONNECTION_STRING);
string commandString =
"INSERT INTO MeetingEntries (Subject, Location, [Start Date], [End Date], [Enable Alarm], [Repeat Alarm], Reminder, [Repetition Type])" + " VALUES (@Subject, @Location, @StartDate, @EndDate, @EnableAlarm, @RepeatAlarm, @Reminder, @RepetitionType)";
//"INSERT INTO MEETINGENTRIES (SUBJECT, LOCATION, START DATE, END DATE, ENABLE ALARM, REPEAT ALARM, REMINDER, REPETITION TYPE)" + " VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
OleDbCommand commandStatement = new OleDbCommand(commandString, dbConnection);
commandStatement.Parameters.Add("Subject", OleDbType.VarWChar, 30).Value = currentEntry.Subject;
commandStatement.Parameters.Add("Location", OleDbType.VarWChar, 50).Value = currentEntry.Location;
commandStatement.Parameters.Add("StartDate", OleDbType.Date, 40).Value = currentEntry.StartDateTime.Date;
commandStatement.Parameters.Add("EndDate", OleDbType.Date, 40).Value = currentEntry.EndDateTime.Date;
commandStatement.Parameters.Add("EnableAlarm", OleDbType.Boolean, 1).Value = currentEntry.IsAlarmEnabled;
commandStatement.Parameters.Add("RepeatAlarm", OleDbType.Boolean, 1).Value = currentEntry.IsAlarmRepeated;
commandStatement.Parameters.Add("Reminder", OleDbType.Integer, 2).Value = currentEntry.Reminder;
commandStatement.Parameters.Add("RepetitionType", OleDbType.VarWChar, 10).Value = currentEntry.Repetition.ToString();
dbConnection.Open();
commandStatement.CommandText = commandString;
commandStatement.ExecuteNonQuery();
}
please clarify or tell us the scenario...
From program.cs
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());//the name of the form :)
}
Application.Run(new Form1());
So please attach here your application with the database, so I can help you better
It means the query run on Access database "INSERT INTO MeetingEntries (Subject, Location, Start Date, End Date, Enable Alarm, Repeat Alarm, Reminder, Repetition Type) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" which is wrong!
foreach(Control c in tableLayoutPanel1.Controls)
{
if( c is TextBox)
c.Text = null;
else if (c is CheckBox)
c.Checked = false;
else
//.....
}
Man! please read what I posted please commandStatement.CommandText in debug mode will show you the command gonna be executed! take it copy and paste in access and run it.
Please before commandStatement.ExecuteNonQuery();
get the commandStatement.CommandText
and execute the query into access. see if it runs or not.
Can you please show us the exception?
or try currentEntry.EndDateTime.Date.ToShortDateString();
What do you mean by Clear the table layout? to reset all controls value i.e all textboxs Text property = null or to set the visibility = false
You can access all TableLayoutPanel controls by tableLayoutPanel1.Controls
To solve it and I assume taxableIncome is TextBox or Label
taxableIncome.Text = Convert.ToDouble(userValueTB.Text).ToString();
What's taxableIncome? please use code tags!
To solve second error
taxLBL.Text = Convert.ToDouble(taxLBL.Text).ToString();
I didn't completely figure it out but did you try this?
comboBox1.SelectedIndex = comboBox1.FindString("UserName");
Create table for recipe (name, description, avg. time to do it, how to make it etc..)
Create table form ingredients (name, etc..)
Create bridge table for both tables (DB concepts)
It's almost done!
Make a program to connect to this database search on (recipe name or recipe description) and show how to make it and some light logic.
You should thank your mom because she'll make you learn something new.
I don't like the sign... It should be visible by default not just when I over my mouse on someone profile picture!
Use AddRange method instead
ListBox2.Items.AddRange(ListBox1.Items);
Friend.. I can suggest another design
class User {
//user properties, methods on the user instance
}
class UserCollection : IList<User> {
//users properties, methods on the users instance like add/remove...
}
Can you please move your thread to ASP.NET Forum to get lots of answers http://www.daniweb.com/forums/forum18.html
No excuses friend, I'm sorry as I couldn't help..
I can't test it with you as I have VS professional edition, if you allow me to use Team Viewer and access your machine I'll do, if you don't; then no problem.
dear it's another question :) please mark it as solved to help people find relevant threads.
Start new thread with another question.
Yes :)
So,
1- uninstall Report Viewer.
2- Reset the Visual Studio Environment http://www.platinumbay.com/blogs/dotneticated/archive/2007/09/02/reset-the-visual-studio-environment.aspx
3- Reinstall Report Viewer (please make sure that VS is 2008 and Report Viewer is 2008)
Feed me back :)
Select it then press the button... if you don't like to do it this way.. you may then replace selectedNode in my code with specific node.
If you're newbie.. please read in generics, arrays, and files
Generics http://msdn.microsoft.com/en-us/library/512aeb7t(VS.80).aspx
Arrays http://msdn.microsoft.com/en-us/library/aa288453(VS.71).aspx
File http://msdn.microsoft.com/en-us/library/system.io.file(VS.80).aspx
.mdt file?
please clarify your question...
use generics...
List<string> personsData = new List<string>();
string personData = "name,phone,number,postcode";
personsData.Add(personData);
//use System.IO.File class to store personsData content...
Do you see the ReportViewer control when you're trying to add them to the toolbox?
Add two buttons btnAdd, btnDelete.. create event handler (onClick) for both
private void btnAdd_Click(object sender, EventArgs e)
{
TreeNode selectedNode = treeView1.SelectedNode;
selectedNode.Nodes.Add("New node"); //prompt it as textbox or by any way you see..
}
private void btnDelete_Click(object sender, EventArgs e)
{
TreeNode selectedNode = treeView1.SelectedNode;
if (selectedNode.Parent == null)
MessageBox.Show("Can't remove root node");
else
selectedNode.Remove();
}