|
i did't find so only ask..
Thanks & Regards
AR
|
|
|
|
|
Dear all,
I find out Facebook does a good way of handling photos:
1) You can add photos to an album at any time.
2) You can rearrange the order at any time.
3) You can add/modify description to the album at any time.
4) You can add/modify description to each photo at any time.
I want to have the same functionality available in my local computer. That means when I get into my album folder, maybe I click on a page or a program, it will allow me to do the above 4 things.
Usually I arrange my photos like this:
E drive
+ Photo 2012
+ Photo 2013
+-- 2013-01-01 New Years Day
+---+ Photo0107.jpg
+---+ Photo0108.jpg
+---+ Photo0109.jpg
...
+-- 2013-02-14 Romantic Dinner
+---+ CIMG0907.jpg
+---+ CIMG0908.jpg
+---+ CIMG0909.jpg
...
Please note that I want to keep it simple. I think Facebook is a web thing. It uses Ajax to handle the photos. I don't want to install a web server in my computer. Please provide any pointer, whether there is on the shelf product, whether this is achievable using C#, or have to use ASP.NET / Ajax / php / etc. Thanks.
|
|
|
|
|
You seem to be on a shopping exercise to get a desktop photo/image management system or are you going to try and build such a tool, you don't actually ask a question.
Have you attempted to search for such a program yourself, I would suggest Google may be of service for this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how to create messagebox if save record success with sum record
exemple
string save=string.format("insert into quantity([input])values('{0}')",texbox1.tex);
sqlconection con new sqlconection();
con.open();
sqlcommend cmd = new sqlcommend();
cmd.excutenonQuery();
con.close();
i want to show message=> messagebox.show"(Rcord 10 Item ");
|
|
|
|
|
1 Your insert query is wrong
2 You are using unverified data directly from your user - look up Little Bobby tables
3 You have no output from sql to get the information
Personally I would build a parameterised stored procedure that insert/updates the record and returns the sum you are looking for. the result to be returned as either a single integer value using ExecuteScalar or as a table.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i want to show messagebox sum row/record with messagebox
private void bsave_Click(object sender, EventArgs e)
{
string save = string.Format("Insert into ShippingCompany([ShippingCompanyCode],[ShippingCompanyName],[CurenccyCode],[ActiveStatus],[CreateBy],[CreateDate],[modifiedBy],[modifiedDate])values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", t1.Text, t2.Text, t3.Text, t4.Text, t5.Text, DateTime.Now.ToString("yyyy-mm-DD" + "HH:mm:ss"), t7.Text, DateTime.Now.ToString("yyyy-mm-DD" + "HH:mm:ss"));
SqlConnection con = new SqlConnection(dikonek);
con.Open();
SqlCommand cmd = new SqlCommand(save, con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("?");
|
|
|
|
|
You did not understand my last answer, you obviously have no idea how to do database operations and you are making the most basic error by storing dates as text.
PLEASE get a book, work through the examples and then do some tutorials on the subject, you do not even have enough knowledge yet to as sensible questions.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
What Mycroft has stated is correct you shouldn't store dates in the database as strings but I wont go into that as he already has.
If you look at the ExecuteNonQuery[^] documentation you will see that the method returns a value indicating the number of rows effected.
you can then use this value in a string.
string Message = String.Format("Number of rows affected {0}", result);
MessageBox.Show(Message);
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Avoiding SQL Injection[^] isn't hard:
string save = "Insert into ShippingCompany ([ShippingCompanyCode], [ShippingCompanyName], [CurenccyCode], [ActiveStatus], [CreateBy], [CreateDate], [modifiedBy], [modifiedDate]) "
+ "values (@ShippingCompanyCode, @ShippingCompanyName, @CurenccyCode, @ActiveStatus, @CreateBy, @CreateDate, @modifiedBy, @modifiedDate)";
using (SqlConnection con = new SqlConnection(dikonek))
using (SqlCommand cmd = new SqlCommand(save, con))
{
cmd.Parameters.AddWithValue("@ShippingCompanyCode", t1.Text);
cmd.Parameters.AddWithValue("@ShippingCompanyName", t2.Text);
cmd.Parameters.AddWithValue("@CurenccyCode", t3.Text);
cmd.Parameters.AddWithValue("@ActiveStatus", t4.Text);
cmd.Parameters.AddWithValue("@CreateBy", t5.Text);
cmd.Parameters.AddWithValue("@CreateDate", DateTime.Now);
cmd.Parameters.AddWithValue("@modifiedBy", t7.Text);
cmd.Parameters.AddWithValue("@modifiedDate", DateTime.Now);
con.Open();
int rowsAffected = cmd.ExecuteNonQuery();
MessageBox.Show(string.Format("{0} rows affected.", rowsAffected));
}
You should also consider giving your controls more meaningful names than t1 , t2 , etc.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I am trying the following code to create a new XML document but getting the above error.
could you please help..
xml_document = new XDocument();
xml_document.Declaration = new XDeclaration("1.0", "utf-8", "true");
xml_document.Add(new XElement("EventLog"));
XElement event_node = new XElement("Event", new XAttribute("ID", Guid.NewGuid().ToString()));
XElement event_date = new XElement("DateTime", DateTime.UtcNow.ToString("ddd dd MMM yyyy HH:mm:ss"));
XElement event_details = new XElement("Description", event_description);
event_node.Add(event_date);
event_node.Add(event_details);
xml_document.Add(event_node);
xml_document.Save("eventlog.xml");
Technology News @ www.JassimRahma.com
|
|
|
|
|
Shouldn't event_node be added to the root "EventLog " node?
/ravi
|
|
|
|
|
Exactly! OP is trying to add more than one root node to a document which is of course nonsense.
Regards,
— Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
How can I fix it?
My xml structure is like this:
<eventlog>
<event id="[GUID]">
<datetime><datetime
>
<description><description>
<event>
<eventlog>
Technology News @ www.JassimRahma.com
|
|
|
|
|
Empty structures are the best!
I guess something went wrong there?
|
|
|
|
|
As Ravi said, you need to add the event_node to the root node, not the document:
xml_document.Root.Add(event_node);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
See my reply here[^].
/ravi
|
|
|
|
|
Try this:
xml_document = new XDocument();
xml_document.Declaration = new XDeclaration("1.0", "utf-8", "true");
XElement rootEle = new XElement("EventLog")
xml_document.Add(rootEle);
XElement event_node = new XElement("Event", new XAttribute("ID", Guid.NewGuid().ToString()));
XElement event_date = new XElement("DateTime", DateTime.UtcNow.ToString("ddd dd MMM yyyy HH:mm:ss"));
XElement event_details = new XElement("Description", event_description);
event_node.Add(event_date);
event_node.Add(event_details);
rootEle.Add(event_node);
xml_document.Save("eventlog.xml");
/ravi
|
|
|
|
|
Thanks Ravi. It solved my problem.
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
I wanna know how can I determine if Google Drive is installed on the machine and what's the drive folder?
How can I do this please?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: how can I determine if Google Drive is installed Enumerate the installed programs, see if it's there.
Jassim Rahma wrote: and what's the drive folder? Enumerate all drives, and ask for the drive's details (like it's size) using e.g. WMI. It might not spit out that it's a GDrive, but if the app is installed and there's only one drive that does not give a detail like a cluster-size, chances are, that's the GDrive.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
To find out if GDrive is running:
using System.Diagnostics;
private bool IsGDriveRunning()
{
return Process.GetProcessesByName("googledrivesync").Length > 0;
} One way to get the filepath of the running process:
Process[] gDrive = Process.GetProcessesByName("googledrivesync");
if (gDrive.Length > 0)
{
Console.WriteLine(gDrive[0].Modules[0].FileName);
} But, there may be some issues using depending on whether you are compiling to a 32- or 64- bit application. See the discussion here: [^]. Right after that post is an example showing how to use WMI.
On my Win 8/64 system GDrive runs two googledrivesync.exe processes, both resolve to the same file. Your mileage may vary.
If you seek to aid everyone that suffers in the galaxy, you will only weaken yourself … and weaken them. It is the internal struggles, when fought and won on their own, that yield the strongest rewards… If you care for others, then dispense with pity and sacrifice and recognize the value in letting them fight their own battles." Darth Traya
|
|
|
|
|
Hi,
I have csv file which contains 1 million records and with column 160. I have to insert(update the csv file) more 60 columns in the same file so the total column finally will generated 220.
60 columns and there data will get update like -
for first Row I have to select values from column 2,3,4 and generate the url and execute the url so that I will get xml data. Then I have to parse that data and fill 60 columns for that perticular row.
Like same I have to do for 2 row and 3row....upto 1 million. I have to process this file within 3 hrs.
How I can improve the performance of the reading and writing to csv file.
Regards,
sjs
modified 19-Dec-13 8:59am.
|
|
|
|
|
Sionce we know nothing of your code, it's prretty much impossible to tell you how to improve the performance.
|
|
|
|
|
Here, on CP, Sebastien Lorion's very popular 2011 article, and code, "A Fast CSV Reader," immediately comes to mind: [^]. I think you'll find a good strategy for optimizing access to your file in that article.
But, given: "I have to select values from column 2,3,4 and generate the url and execute the url so that I will get xml data:" does this mean you are writing XML into your CSV file ?
... edit ... you might also examine the open-source file library, FileHelpers: [^]. I have not used this library.
If you seek to aid everyone that suffers in the galaxy, you will only weaken yourself … and weaken them. It is the internal struggles, when fought and won on their own, that yield the strongest rewards… If you care for others, then dispense with pity and sacrifice and recognize the value in letting them fight their own battles." Darth Traya
modified 19-Dec-13 10:16am.
|
|
|
|
|
1 million records isn't so much. The real advantage is you can spawn multiple threads each with a different start point all writing to a different output file then have another app combine the outputs. But if the file was only a few GB I would just load the entire thing into ram in one quick blit and get it over with.
|
|
|
|
|