15,903,362 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by JeseemRazak619 (Top 12 by date)
JeseemRazak619
12-Feb-14 4:42am
View
ok... thank you sir.
JeseemRazak619
12-Feb-14 4:31am
View
yes.. i am trying to zip the MS Access file..
JeseemRazak619
11-Feb-14 15:53pm
View
sir i want to transfer the database file using a pen drive or something like that. is it posible with sql
JeseemRazak619
11-Feb-14 15:25pm
View
when i try to convert an image file into byte and save it as .txt format... it takes time but the size of file is too small... then i try the same with sql database. it perform good but i dont know what's the size of file and also its not portable na... thats why i am trying to do this with MS Access
JeseemRazak619
4-Jul-13 3:34am
View
Deleted
http://msdn.microsoft.com/en-us/library/ms165429(v=vs.80).aspx
JeseemRazak619
5-Oct-12 13:01pm
View
Deleted
private void Update_Click(object sender, EventArgs e)
{
if (txtfname.Text != "" && txtlname.Text != "")
{
try
{
// Read the Data From All fields
string fname = txtfname.Text;
string lname = txtlname.Text;
string house = txthouse.Text;
string city = txtcity.Text;
string country = txtcountry.Text;
string state = txtstate.Text;
string post = txtpost.Text;
string mail = txtmail.Text;
string blood = txtblood.Text;
string mobile = txtmobile.Text;
string dob = txtdob.Text;
byte[] imagedata = ReadFile(path.Text);
SqlConnection con = new SqlConnection(conn);
//update query
string query = "UPDATE address SET firstname ='" + fname + "',lastname='" + lname + "',house='" + house + "',city='" + city + "',country='" + country + "',state='" + state + "',post='" + post + "',mail='" + mail + "',blood='" + blood + "',mobile='" + mobile + "',dob='" + dob + "',image=@image WHERE (firstname ='" + fname + "' AND lastname='" + lname + "')";
SqlCommand cmd = new SqlCommand(query, con);
cmd.Parameters.Add(new SqlParameter("@image", (object)imagedata));
con.Open();
int i;
i = cmd.ExecuteNonQuery();
if (i == 1)
{
rInsert.Text = "Address Updated Sucessfully...!!!";
}
else
{
rInsert.Text = "Name not found in Database...!!!";
}
con.Close();
}
catch (Exception)
{
MessageBox.Show("Unable to Update...!!!", "Error occur", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("Please Insert first name and last name"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
//coverting image to bytes for storing in data base
byte[] ReadFile(string sPath)
{
//Initialize byte array with a null value initially.
byte[] data = null;
//Use FileInfo object to get file size.
FileInfo fInfo = new FileInfo(sPath);
long numBytes = fInfo.Length;
//Open FileStream to read file
FileStream fStream = new FileStream(sPath, FileMode.Open, FileAccess.Read);
//Use BinaryReader to read file stream into byte array.
BinaryReader br = new BinaryReader(fStream);
//When you use BinaryReader, you need to supply number of bytes to read from file.
//In this case we want to read entire file. So supplying total number of bytes.
data = br.ReadBytes((int)numBytes);
return data;
}
JeseemRazak619
10-Sep-12 13:33pm
View
the code works good when i change my connection string.thanks u sir
JeseemRazak619
10-Sep-12 4:32am
View
image
JeseemRazak619
10-Sep-12 4:32am
View
windows application
JeseemRazak619
10-Sep-12 4:28am
View
Deleted
the datatype given to image is 'image'.its an windows application
JeseemRazak619
10-Sep-12 4:09am
View
private void button4_Click_1(object sender, EventArgs e)
{
string title = txtsearch.Text.ToString();
if (title != "")
{
string conn = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|NORTHWND.MDF;Integrated Security=True;User Instance=True";
SqlConnection con = new SqlConnection(conn);
con.Open();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("SELECT firstname,lastname,house,city,country,state,post,mail,blood,mobile,dob FROM address WHERE firstname LIKE'" + title + "%' OR lastname LIKE'" + title + "%'", con);
da.Fill(ds, "address");
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "address";
con.Close();
}
else
{
MessageBox.Show("You muste enter name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
//in same program the above code works successfully.
JeseemRazak619
10-Sep-12 3:59am
View
No error. its showing successful but in database the data's are not stored
Show More