|
amx_tiger wrote: So, I can't see if the bitmap was modified in Paint ?
If Paint does not add some specific documented signature then you will not be able to.
amx_tiger wrote: Any solution?
Check the last modified date against the created date.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
I though at last modified date, but isn't a perfect solution because the player can save the bitmap with the "Save as...", with the same format and name , then the last modified date it's the same with the time creation
@Eddy: No, the computers aren't under my control. The plugin for screenshot have some information like: the time when the admin take the player screenshot,the nickname of admin, nothing else...
Thank you both for your help.
modified 22-Apr-12 8:55am.
|
|
|
|
|
The ONLY solution you have is to has the file when it's saved and keep that data in a seperate file. When the image is reloaded, hash the file again and compare to the original hash.
|
|
|
|
|
i want a perim algorithm in C#.
please introduce me Helpful E-Books about Greedy Algorithms and source codes with examples.
thank you very MUCH.
|
|
|
|
|
I have no idea[^] but that never stops me.
|
|
|
|
|
i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear
it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S
so plz i need help in this
|
|
|
|
|
Mohamed Nabawy wrote: it's difficult to make this buttons add in runtime beside other
No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?
|
|
|
|
|
first thanks ,i know what u say .. but i wanna to make it ana my boss need this
|
|
|
|
|
Mohamed Nabawy wrote: my boss need this
Bosses rarely know what they need or want. Most times you need to tell them what they need.
Adding a Button at runtime is easy:
0) Instantiate it
1) Set the Text
2) Set the Location
3) Attach event handlers as needed
4) Add it to the Controls collection of the parent (Form)
System.Windows.Forms.Button b = new System.Windows.Forms.Button () ;
b.Text = "Push me" ;
b.Location = new System.Drawings.Point ( x , y ) ;
b.Click += someclickhandler ;
this.Controls.Add ( b ) ;
|
|
|
|
|
i will use it in touch screen So buttons is better than combobox
|
|
|
|
|
i need if row add automatic add button in runtime and be fixed once another row added not every time add all rows in runtime ? ... are this available ?
|
|
|
|
|
Yes. It should be possible - however, you need to try it out.
|
|
|
|
|
iam tring now.. and i havn't any idea how to add tool in runtime and make it fixed not evey time add from 0 ?
|
|
|
|
|
i take this program in c# from code project and this code is written by phd student in UK and he from jordon
when i try to modfiy it i hove some problem in insert & update (syntax error ) but the search and delete is work fine
here is the complet code after my modifying
can you help me pls
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace WindowsApplication1
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Button Add_btn;
private System.Windows.Forms.Button up_btn;
private System.Windows.Forms.Button del_btn;
private System.Windows.Forms.Button find_btn;
private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1;
private System.Data.OleDb.OleDbCommand oleDbSelectCommand1;
private System.Data.OleDb.OleDbCommand oleDbInsertCommand1;
private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1;
private System.Data.OleDb.OleDbCommand oleDbDeleteCommand1;
private System.Data.OleDb.OleDbConnection oleDbConnection1;
private WindowsApplication1.DataSet1 dataSet11;
private System.Windows.Forms.Label qurey_label;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.textBox1 = new System.Windows.Forms.TextBox();
this.dataSet11 = new WindowsApplication1.DataSet1();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.Add_btn = new System.Windows.Forms.Button();
this.up_btn = new System.Windows.Forms.Button();
this.del_btn = new System.Windows.Forms.Button();
this.find_btn = new System.Windows.Forms.Button();
this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter();
this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand();
this.qurey_label = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "Db.ID", true));
this.textBox1.Location = new System.Drawing.Point(104, 64);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(216, 20);
this.textBox1.TabIndex = 0;
//
// dataSet11
//
this.dataSet11.DataSetName = "DataSet1";
this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US");
this.dataSet11.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// textBox2
//
this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "Db.dnasequence", true));
this.textBox2.Location = new System.Drawing.Point(104, 104);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(216, 20);
this.textBox2.TabIndex = 1;
//
// textBox3
//
this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "Db.p-name", true));
this.textBox3.Location = new System.Drawing.Point(104, 144);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(216, 20);
this.textBox3.TabIndex = 2;
//
// textBox4
//
this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "Db.address", true));
this.textBox4.Location = new System.Drawing.Point(104, 184);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(216, 20);
this.textBox4.TabIndex = 3;
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 23);
this.label1.TabIndex = 4;
this.label1.Text = "ID";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 104);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 23);
this.label2.TabIndex = 5;
this.label2.Text = "dnasequence";
//
// label3
//
this.label3.Location = new System.Drawing.Point(16, 144);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 23);
this.label3.TabIndex = 6;
this.label3.Text = "p-name";
//
// label4
//
this.label4.Location = new System.Drawing.Point(16, 184);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(80, 23);
this.label4.TabIndex = 7;
this.label4.Text = "address";
//
// Add_btn
//
this.Add_btn.Location = new System.Drawing.Point(40, 16);
this.Add_btn.Name = "Add_btn";
this.Add_btn.Size = new System.Drawing.Size(75, 23);
this.Add_btn.TabIndex = 8;
this.Add_btn.Text = "Add";
this.Add_btn.Click += new System.EventHandler(this.Add_btn_Click);
//
// up_btn
//
this.up_btn.Location = new System.Drawing.Point(136, 16);
this.up_btn.Name = "up_btn";
this.up_btn.Size = new System.Drawing.Size(75, 23);
this.up_btn.TabIndex = 9;
this.up_btn.Text = "Update";
this.up_btn.Click += new System.EventHandler(this.up_btn_Click);
//
// del_btn
//
this.del_btn.Location = new System.Drawing.Point(240, 16);
this.del_btn.Name = "del_btn";
this.del_btn.Size = new System.Drawing.Size(75, 23);
this.del_btn.TabIndex = 10;
this.del_btn.Text = "Delete";
this.del_btn.Click += new System.EventHandler(this.del_btn_Click);
//
// find_btn
//
this.find_btn.Location = new System.Drawing.Point(16, 312);
this.find_btn.Name = "find_btn";
this.find_btn.Size = new System.Drawing.Size(320, 24);
this.find_btn.TabIndex = 11;
this.find_btn.Text = "Find";
this.find_btn.Click += new System.EventHandler(this.find_btn_Click);
//
// oleDbDataAdapter1
//
this.oleDbDataAdapter1.DeleteCommand = this.oleDbDeleteCommand1;
this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1;
this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Db", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("ID", "ID"),
new System.Data.Common.DataColumnMapping("dnasequence", "dnasequence"),
new System.Data.Common.DataColumnMapping("address", "address"),
new System.Data.Common.DataColumnMapping("p-name", "p-name")})});
this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1;
//
// oleDbDeleteCommand1
//
this.oleDbDeleteCommand1.CommandText = "DELETE FROM Db WHERE (ID = ?) AND (address = ? OR ? IS NULL AND addonNumber IS NU" +
"LL) AND (dnasequence = ? OR ? IS NULL AND dnasequence IS NULL) AND (p-name = ? O" +
"R ? IS NULL AND p-name IS NULL)";
this.oleDbDeleteCommand1.Connection = this.oleDbConnection1;
this.oleDbDeleteCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
new System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(10)), ((byte)(0)), "ID", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_address", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "address", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_address1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "address", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_dnasequence", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "dnasequence", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_dnasequence1", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "dnasequence", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_p-name", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "p-name", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_p-name1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "p-name", System.Data.DataRowVersion.Original, null)});
//
// oleDbConnection1
//
this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\MOHAMMED\\Downloads\\Ado_src\\" +
"WindowsApplication1\\Db.mdb";
//
// oleDbInsertCommand1
//
this.oleDbInsertCommand1.CommandText = "INSERT INTO Db(p-name, address, ID, dnasequence) VALUES (?, ?, ?, ?)";
this.oleDbInsertCommand1.Connection = this.oleDbConnection1;
this.oleDbInsertCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
new System.Data.OleDb.OleDbParameter("p-name", System.Data.OleDb.OleDbType.VarWChar, 50, "p-name"),
new System.Data.OleDb.OleDbParameter("address", System.Data.OleDb.OleDbType.VarWChar, 50, "address"),
new System.Data.OleDb.OleDbParameter("ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(10)), ((byte)(0)), "ID", System.Data.DataRowVersion.Current, null),
new System.Data.OleDb.OleDbParameter("dnasequence", System.Data.OleDb.OleDbType.VarWChar, 200, "dnasequence")});
//
// oleDbSelectCommand1
//
this.oleDbSelectCommand1.CommandText = "SELECT p-name, address, ID, dnasequence FROM Db";
this.oleDbSelectCommand1.Connection = this.oleDbConnection1;
//
// oleDbUpdateCommand1
//
this.oleDbUpdateCommand1.CommandText = resources.GetString("oleDbUpdateCommand1.CommandText");
this.oleDbUpdateCommand1.Connection = this.oleDbConnection1;
this.oleDbUpdateCommand1.Parameters.AddRange(new System.Data.OleDb.OleDbParameter[] {
new System.Data.OleDb.OleDbParameter("p-name", System.Data.OleDb.OleDbType.VarWChar, 50, "p-name"),
new System.Data.OleDb.OleDbParameter("address", System.Data.OleDb.OleDbType.VarWChar, 50, "address"),
new System.Data.OleDb.OleDbParameter("ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(10)), ((byte)(0)), "ID", System.Data.DataRowVersion.Current, null),
new System.Data.OleDb.OleDbParameter("dnasequence", System.Data.OleDb.OleDbType.VarWChar, 200, "dnasequence"),
new System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, false, ((byte)(10)), ((byte)(0)), "ID", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_address", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "address", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_address1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "address", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_dnasequence", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "dnasequence", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_dnasequence1", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "dnasequence", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_p-name", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "p-name", System.Data.DataRowVersion.Original, null),
new System.Data.OleDb.OleDbParameter("Original_p-name1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "p-name", System.Data.DataRowVersion.Original, null)});
//
// qurey_label
//
this.qurey_label.Location = new System.Drawing.Point(40, 224);
this.qurey_label.Name = "qurey_label";
this.qurey_label.Size = new System.Drawing.Size(288, 72);
this.qurey_label.TabIndex = 12;
this.qurey_label.Text = "Qurey";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(360, 366);
this.Controls.Add(this.qurey_label);
this.Controls.Add(this.find_btn);
this.Controls.Add(this.del_btn);
this.Controls.Add(this.up_btn);
this.Controls.Add(this.Add_btn);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void find_btn_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDataAdapter1.SelectCommand.CommandText =
"SELECT * FROM Db WHERE ID = "+ this.textBox1.Text;
// clear the DataSet from the last operation
dataSet11.Clear();
this.oleDbDataAdapter1.Fill(this.dataSet11.Tables["Db"]);
}
catch(System.Data.OleDb.OleDbException exp)
{
MessageBox.Show(exp.ToString());
}
//copy the dataset in datatable object
DataTable dataTable = dataSet11.Tables[ 0 ];
//if the row count = 0 then the qurey return nothing
if ( dataTable.Rows.Count == 0 )
MessageBox.Show("the Record not founded");
}
private void Add_btn_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDataAdapter1.InsertCommand.CommandText =
"INSERT INTO Db (p-name, address, ID, dnasequence)" +
"VALUES ('"+ this.textBox3.Text +"','"+this.textBox4.Text+
"' , "+ this.textBox1.Text +",'"+ this.textBox2.Text+ "')";
//open the bridge between the application and the datasource
this.oleDbConnection1.Open();
this.oleDbDataAdapter1.InsertCommand.Connection = oleDbConnection1;
//execute the qurey
this.oleDbDataAdapter1.InsertCommand.ExecuteNonQuery();
//close the connection
this.oleDbConnection1.Close();
MessageBox.Show("Record insedted Successfully"); //inform the user
//clear the form
this.textBox2.Text = "";
this.textBox1.Text = "";
this.textBox3.Text = "";
this.textBox4.Text = "";
//show the qurey
this.qurey_label.Text = "";
this.qurey_label.Text = oleDbDataAdapter1.InsertCommand.CommandText.ToString();
}
catch(System.Data.OleDb.OleDbException exp)
{
//close the connection
this.oleDbConnection1.Close();
MessageBox.Show(exp.ToString());
}
}
private void up_btn_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDataAdapter1.UpdateCommand.CommandText =
"UPDATE Db SET "+
"p-name ='"+ this.textBox3.Text +"', address ='"+this.textBox4.Text +
"', ID ="+this.textBox1.Text+", dnasequence ='"+ this.textBox2.Text+"'" +
" WHERE ID ="+ this.textBox1.Text;
//open the bridge between the application and the datasource
this.oleDbConnection1.Open();
this.oleDbDataAdapter1.UpdateCommand.Connection = oleDbConnection1;
//execute the qurey
this.oleDbDataAdapter1.UpdateCommand.ExecuteNonQuery();
//close the connection
this.oleDbConnection1.Close();
MessageBox.Show("Record updated Successfully"); //inform the user
//clear the form
this.textBox2.Text = "";
this.textBox1.Text = "";
this.textBox3.Text = "";
this.textBox4.Text = "";
//show the qurey
this.qurey_label.Text = "";
this.qurey_label.Text = oleDbDataAdapter1.UpdateCommand.CommandText.ToString();
}
catch(System.Data.OleDb.OleDbException exp)
{
//close the connection
this.oleDbConnection1.Close();
MessageBox.Show(exp.ToString());
}
}
private void del_btn_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDataAdapter1.DeleteCommand.CommandText =
"DELETE FROM Db WHERE ID =" + this.textBox1.Text;
//open the bridge between the application and the datasource
this.oleDbConnection1.Open();
this.oleDbDataAdapter1.DeleteCommand.Connection = oleDbConnection1;
//execute the qurey
this.oleDbDataAdapter1.DeleteCommand.ExecuteNonQuery();
//close the connection
this.oleDbConnection1.Close();
MessageBox.Show("Record deleted Successfully"); //inform the user
//clear the form
this.textBox2.Text = "";
this.textBox1.Text = "";
this.textBox3.Text = "";
this.textBox4.Text = "";
//show the qurey
this.qurey_label.Text = "";
this.qurey_label.Text = oleDbDataAdapter1.DeleteCommand.CommandText.ToString();
}
catch(System.Data.OleDb.OleDbException exp)
{
//close the connection
this.oleDbConnection1.Close();
MessageBox.Show(exp.ToString());
}
}
}
}
|
|
|
|
|
This is just an unformatted code dump. If you really expect an answer you should cut this down to the relevant section of code that you have a problem with and properly format your text.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
private void Add_btn_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDataAdapter1.InsertCommand.CommandText =
"INSERT INTO Db (p-name, address, ID, dnasequence)" +
"VALUES ('"+ this.textBox3.Text +"','"+this.textBox4.Text+
"' , "+ this.textBox1.Text +",'"+ this.textBox2.Text+ "')";
this.oleDbConnection1.Open();
this.oleDbDataAdapter1.InsertCommand.Connection = oleDbConnection1;
this.oleDbDataAdapter1.InsertCommand.ExecuteNonQuery();
this.oleDbConnection1.Close();
MessageBox.Show("Record insedted Successfully");
private void up_btn_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDataAdapter1.UpdateCommand.CommandText =
"UPDATE Db SET "+
"p-name ='"+ this.textBox3.Text +"', address ='"+this.textBox4.Text +
"', ID ="+this.textBox1.Text+", dnasequence ='"+ this.textBox2.Text+"'" +
" WHERE ID ="+ this.textBox1.Text;
this.oleDbConnection1.Open();
this.oleDbDataAdapter1.UpdateCommand.Connection = oleDbConnection1;
this.oleDbDataAdapter1.UpdateCommand.ExecuteNonQuery();
this.oleDbConnection1.Close();
MessageBox.Show("Record updated Successfully");
|
|
|
|
|
They should have told the PhD about sql-injection. And proper OO-code. And proper field-names.
..so, you're looking for somebody to rewrite the "update" and "insert" portions?
Bastard Programmer from Hell
|
|
|
|
|
the orginal code is work without any error thr error arise when i chang the database name and column name and also i chang the names in the code
|
|
|
|
|
What error? Could you explain what needs be changed (insert, update) and why - I don't understand the question yet.
If you change the field-names, then make sure that you update them everywhere. Don't use spaces in names, and don't use keywords.
Bastard Programmer from Hell
|
|
|
|
|
mohammed_1983 wrote: the orginal code is work without any error
Wait a minute.... so you had some code from somewhere that you change a bunch of stuff in and then you expect someone else to go through it and fix what you broke?
Does the database you changed to actually exist? Did you change the connection string? Does the table that you are querying really exist? Do the column names in the table match the names in your code? Is the connection opening?
The best thing you can do right off the bat is change all of that string concatenation to parameterized queries.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Try and debug your source code. Put a breakpoint on the line of the query - once running code hits the breakpoint, copy the query from there into Access and run it. You will get to know where the error is.
|
|
|
|
|
Given a text string and an SVG font I need to create an SVG file where each character is represented by a path.
I know that SVG font is just a collection of glyphs so rendering should be relatively easy. However some operations like calculating position of each character, rendering in different font sizes, etc. may be tricky.
Has anyone come across a solution that implements this?
|
|
|
|
|
i've just created a bouncing animation with maximum 100 ball bouncing inside a rectangle.
and i'd love to create a ball bouncing inside a disorder box shape.
i've search over google and keeps finding bouncing ball with gravity.
i mean the one that bounce diagonally.
anyone know what should i type in google?
i really don't know what people call this animation.
|
|
|
|
|
Is it not possible to modify the source code you already have to modify the animation?
I'm sure with some playing around of the code, you would be able to do something.
|
|
|
|
|
Hej
How can I add navigation bar for min tigrina lexikon.
i mean I wanted a single bar for menu navigation in asp.net
|
|
|
|
|