|
Good morning,
Excuse me, I am French, I speak the language badly Englishman. My question is the following:
I have one banks on look at foundation of data which contains columns Name, Forename, Photograph
I make a request SQL which is the following:
cmd.CommandText ="SELECT NAME, FIRSTNAME, PHOTO FROM USER";
I fill ListView in the following way:
sqlDa = new SqlDataAdapter();
sqlDa.SelectCommand = cmd;
try
{
sqlDa.Fill(dt_ListeUtilisateur);
if (dt_ListeUtilisateur.Rows.Count > 0)
{
lstUtilisateur.DataContext = dt_ListeUtilisateur.DefaultView;
}} //lstUtilisateur = ListView
XAML :
<listview margin="7,10,15,48" name="lstUtilisateur" itemssource="{Binding}" borderbrush="{x:Null}" listboxitem.selected="lstUtilisateur_Selected" selectionchanged="lstUtilisateur_SelectionChanged">
<listview.view>
<gridview>
<gridviewcolumn header="NAME" displaymemberbinding="{Binding Path=NAME}" selector.isselected="True">
<gridviewcolumn header="FIRSTNAME" displaymemberbinding="{Binding Path=FIRSTNAME}">
<gridviewcolumn header="Picture" width="100" displaymemberbinding="{Binding Path=MyImage}">
<gridviewcolumn.celltemplate>
<datatemplate>
In the column Picture of my ListView, I have unfortunately not the photograph but Byte [] Array you can help me please.
|
|
|
|
|
Good morning,
Excuse me, I am French, I speak the language badly Englishman. My question is the following:
I have one banks on look at foundation of data which contains columns Name, Forename, Photograph
I make a request SQL which is the following:
cmd.CommandText ="SELECT NAME, FIRSTNAME, PHOTO FROM USER";
I fill ListView in the following way:
sqlDa = new SqlDataAdapter();
sqlDa.SelectCommand = cmd;
try
{
sqlDa.Fill(dt_ListeUtilisateur);
if (dt_ListeUtilisateur.Rows.Count>0)
{
lstUtilisateur.DataContext = dt_ListeUtilisateur.DefaultView;
}} //lstUtilisateur = ListView
XAML :
<listview margin="7,10,15,48" name="lstUtilisateur" itemssource="{Binding}" borderbrush="{x:Null}" listboxitem.selected="lstUtilisateur_Selected" selectionchanged="lstUtilisateur_SelectionChanged">
<listview.view>
<gridview>
<gridviewcolumn header="NAME" displaymemberbinding="{Binding Path=NAME}" selector.isselected="True">
<gridviewcolumn header="FIRSTNAME" displaymemberbinding="{Binding Path=FIRSTNAME}">
<gridviewcolumn header="Picture" width="100" displaymemberbinding="{Binding Path=MyImage}">
<gridviewcolumn.celltemplate>
<datatemplate>
In the column Picture of my ListView, I have unfortunately not the photograph but Byte [] Array you can help me please.
|
|
|
|
|
Your English is quite good. Part of what you are trying to do, is what I thought from your first post, so it must be reasonable.
I must admit that I didn't read all of the link I gave, but I thought that it dealt with reading and saving images to and from a database. If that is not where your problem is, then can I suggest that you post in the WPF forum here on CP, as your application would seem to be a WPF one.
If loading the photo is your problem, then perhaps you might like to Google for yourself. The search term I used was 'Loading Image from SQLServer C#', to see if there is anything more appropriate.
You seem to be slightly annoyed by my suggesting that you re-word your question. You shouldn't be, I often find that trying to ask something using different words makes me understand it a little better, myself.
Anyway, Good Luck! (Bon chance ????)
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi all,
I have a byte[] to unit function, I would like to have a reverse function that convert unit to byte[], please help. thanks a lot.
public static uint ParseUint(byte[] buffer, int uintLengthInBytes, ref int offset)
{
uint value = 0;
int i, j;
for (i = offset + uintLengthInBytes - 1, j = 0; i >= offset; i--, j++)
value |= (uint)(buffer[i] << (8 * j));
offset += uintLengthInBytes;
return value;
}
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
|
hi, I know that method, the result is wrong. please take a closer look at the original code
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
What? Is it in Big Endian or something? Just Array.Reverse the result?
|
|
|
|
|
sorry, my debugging mistake, you are right. thanks a lot.
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
|
Byte order reversal?
Use System.BitConverter and System.Net.IPAddress.NetworkToHostOrder/HostToNetworkOrder.
One I did earlier:
internal void WriteUInt32(UInt32 i, Int32 ofs, Byte[] buffer) {
Int32 j = IPAddress.HostToNetworkOrder(unchecked((Int32)i));
Byte[] b = BitConverter.GetBytes(j);
b.CopyTo(buffer, ofs);
}
Alan.
|
|
|
|
|
Nice! I'm going to remember that one
|
|
|
|
|
present, and according to data availble as packet by packet.
I want to read the html elements obtained and change the innertext of each html element. I am able to do all these.
The main thing is I want the changed text should be visible to user directly instead of original text which is obtained in packets.
How can I do this?
If I had to use threading, How can I do that?
or If I can user timers, how can I do this?
Say correct solution. If there are any examples, it would be so much helpful for me...
|
|
|
|
|
|
the //error? line needs to be in a class definition but not inside of a function
|
|
|
|
|
Hi There,
I am Using FFMpeg in my project and it was great going. I am struck in a position where I need to fetch the Time when a blank screen comes in between a video file. It will be great if you help me in this Issue.
Thanks & Regards
|
|
|
|
|
You're going to have to find a forum specific to the library you're using. What you're asking has nothing to do with C# or the .NET Framework at all.
|
|
|
|
|
hi everybody
i m using C# Application
i have a 'date' and 'days' columns in datagridview
now i want to findout the no. of days between two dates
how can i calculate
pls help me
date days
--------------------------------------------
1/11/2008 0
1/12/2008 30
3/12/2008 2
--------------------------------------------
modified on Monday, May 4, 2009 9:32 AM
|
|
|
|
|
Example :
DateTime d1 = new DateTime(2008, 1, 1);
DateTime d2 = new DateTime(2009, 1, 1);
TimeSpan ts = d2.Substract(d1);
ts.TotalDays <- is the value you want.
|
|
|
|
|
Hello,
I use dataadapter to fill datagrid (using datatable).
dataAdapter =
new SqlDataAdapter(selectcommand3, connectionstring);
But my sql query command is too long. because i receive an error that sqlexception was unhandled (incorrect syntax near '='). But when i write another much shorter sql query it works fine. What can i do to solve it?
|
|
|
|
|
Use stored procs
only two letters away from being an asset
|
|
|
|
|
|
You don't know what stored procedures are?
only two letters away from being an asset
|
|
|
|
|
|
Then go away and don't come back until you do.
only two letters away from being an asset
|
|
|
|
|
That depends on the query. It's not really that the query is too long, but probably that the DataAdapter will only work with queries that return data from a single table with a primary key.
|
|
|
|