|
sirisha guttikonda wrote: new MemoryStream(photoByte, 0, photoByte.Length)
sirisha guttikonda wrote: ms.Write(photoByte, 0, photoByte.Length);
When you call new MemoryStream(photoByte, 0, photoByte.Length) , the contents in the photoByte will be written to the stream. So calling the Write() again is pointless. Here is a code which worked at my end
using(MemoryStream stream = new MemoryStream(photoByte,0,photoByte.Length))
using (Image image = Image.FromStream(stream))
{
image.Save(@"filename.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
|
|
|
|
|
|
Hi!
I have the following situation: a DataGridView is bound to a database table (say TChild). Within this table there is a foreign key to another table (say TParent). I use a combobox column to display the possible values of the foreign key within the DGV.
The TParent table has a column called "IsOpen" telling us whether a row is open or closed. The user should not be able to select a closed TParent out of the combobox.
Where it comes to a problem is that the user can "open" or "close" the TParent. As a consequence:
- a given row is not part of the combobox anymore.
- the same row still exists in the database, as a value saved by the users.
When I try to populate the column with those saved values, an exception is thrown, stating that the value is invalid.
What solution would you recommend?
Ideally, I would have liked a solution where the inactive value is not present in the drop down list but still gets displayed in the DGV.
Thanks
|
|
|
|
|
listen,
i set my datagriviews to read only, i don´t edit there, i edit on comboboxes and textboxes(or whatever) i place then above.
i set values from comboboxes and textboxes
i get values from datagridview
i fill textboxes with sql_procedures i created like all_countries; the display_member is country_name and the source_member is id_country. i assume you done that.
when i navigate datagridview, combobox gets the selected/focus value.
ComboBox_CountryName.Text = DataGridView_CountryPage[1, Variables.DataGridView_Index].Value.ToString();
about the inactive value i edit the table country in page country, after when i enter page client refresh is triggered on load and value is added/deleted/edit for the use of the table client that has a combobox named country
(you can do everthing in same page doesn´t matter)
i don´t see the problem there, if is the code or you are structuring it wrong
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Thanks for your answer.
This is a way to do it. But I was looking for a way that allows me to edit directly inside the DGV...
|
|
|
|
|
never done that, i dont like it but, i would only alter the sets and the gets you see.
get data from datagridcell instead textbox (or whatever)
i see your problem is about how to code that, i can´t post that here too big (c# + sql), don´t worry is simply!!!
you have to create a sql_procedure to refresh the dgv (after your edit procedure), something very simply like "select * from mytable", create the edit procedures as well
so when you
change data on dgv, trigger procedure edit after that refresh dgv (with whatever event you like)
dgv will be refresh with new data.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi dudes,
Is there any straight forward way for reading cookies of a specific domain from my windows application in c#?
|
|
|
|
|
Cookies are kept as text files in the browser defined folder. If you are able to get that folder, I think you can read it. BTW, what is the use of reading cookie in a stand alone application?
modified on Monday, September 22, 2008 4:55 AM
|
|
|
|
|
Suppose there are two pages: page1 and page2
If I connect to page1, a cookie is set for me and I can be recognized in page2 if I send back the cookie received from the first page.
I am connecting to page1 via HttpWebRequest class and am successfully receiving cookie in CookieContainer property. But when I send back the cookie to page2, page2 does not remember me. It seems the the cookie has been deleted from server right after the first request. I'm sure that I'm sending the cookie to page2 through the second request because I did an experiment:
I connected to page1 via Firefox. Then I copied the cookie returned from page1 and programatically sent it to page2 via HttpWebRequest, and page2 recognized me! So I concluded that I'm successfully sending the cookie to second page. This is why I'm trying to access Firefox cookies. Then I can send this cookie to page2.
|
|
|
|
|
Hi,
I'm loading a simple HTML form in a C# form using the WebBrowser control:
webBrowser.Navigate("registration.htm");
The form has a Submit button, which when clicked should open the default Browser and POST this data to the form handler on a website.
I've found suggestions to handle this form locally or in the WebBrowser control itself, but none that describe how to make sure that the Submit button (in HTML) can lead to the default browser to open.
Any ideas?
Thanks,
Sarab
|
|
|
|
|
sir,
how to set marquee the user enter in textbox in asp.net(c#)
|
|
|
|
|
asp.net questions belong in the asp.net forum!
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
How i signed my dll or assembly.I want detailed information(with small example).
|
|
|
|
|
|
|
U r here to answer questions if you not know the ans then please keep kalm
|
|
|
|
|
I think you need to know that no one is here being paid for answering questions. So while asking questions, always remember that you are asking for help and not assigning job to your employees.
The biggest trick is that it takes just a bit of politeness to get help from others. Try this and you will never be disappointed.
By the way I have given him the most useful link of his life (to learn how can we use Google) this will help him in finding answer of his most of ‘how to’ questions.
Thanks for your nice words.
-Dave.
|
|
|
|
|
Ashutosh_Bodake wrote: I want detailed information(with small example).
Well bully for you. I want Cindy Crawford's home phone number and I'm not likely to get that out of this forum either.
You do know that people who answer questions here are volunteers only, and are under NO obligation to do anything for you? We aren't paid. We don't work for Code Project. So, you are unlikely to get a detailed explanation of code signing in an answer to a post - you have been given perfectly valid links, so I suggest you follow them.
BTW - one of the basic skills of any competent developer is to be able to research things for themself. Google would have given you more than enough information - so stop being lazy, and learn how to think for yourself.
|
|
|
|
|
I've got Cindy's number....want it? Can't have it!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey pet my friend salsbery has a number of Cindey.Pls call him so he kick you from this forum.
|
|
|
|
|
We are developing a chat messenger using WCF.
We want to implement SSL security while login. I have read Gtalk (desktop application) also uses SSL while Login; but i dont know how.
Please give your valuable suggestions.
modified on Monday, September 22, 2008 2:07 AM
|
|
|
|
|
Hi all
Am dont hav much knowledge abt Satelite Assembly.I interest to learn that concept.If any body give me Usefull link for Satelite Assembly in C#.Net.....
Thanx
Mohan t working for N.I.C
|
|
|
|
|
Google is your friend[^]
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
I have listview (left side) in the screen and right side 3 radio buttons.
I Want to implement in .Net windows application using C#.net (2.o framwork).
LIst view nodes are fixed. When I open any root nodes it should display the child nodes and at the same time, i need to display the the 3 radiobuttons for each child node. When I collapse the root node then child nodes should collapse as well as the radio button should not be displayed.
eg:
Fruites
---> Mango Radio button1 Radio Button 2 Radio Button3
---> Apple Radio button1 Radio Button 2 Radio Button3
Vegetables
---> Tomoto Radio button1 Radio Button 2 Radio Button3
Can any one give me some hint to implement this.
thanks in advance
Prabhakar
|
|
|
|
|
Hi every body,
I am getting a problem when i work with Microsoft.Interop.Excel.dll
I tried to export and modify excel file with my conditional formatting for each cell of rows.
the function is :
Microsoft.Office.Interop.Excel.Range cellitem;
cellitem.FormatConditions[1].Modify(XlFormatConditionType.xlExpression, XlFormatConditionOperator.xlEqual, "=AND($X$" + position + ">2,MOD($X$" + position + ",2)=0)", "");
it was working good in English region but when i changed the region to Germany(de) it was crashed.
I don't know what is wrong .
Could you help me any solutions!
Thanks,
modified on Monday, September 22, 2008 2:28 AM
|
|
|
|