|
Thanks have done that as well
no change to outcome
string query;
query ="insert into testimage (id_image,pic) values('t', @pic)";
msI.Position=0;
System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand(query,OdbcCon );
cmd.Parameters.Add("@pic",System.Data.Odbc.OdbcType.Image);
cmd.Parameters["@pic"].Value = msI.ToArray();
cmd.Prepare();
cmd.ExecuteNonQuery();
MessageBox.Show("Image Added");
thanks again for your help so far
Just for clarification i'm using Mysql as the DB
and sharpdeveloper for my IDE
And using MySQL ODBC 3.51 Driver for the odbc conention
modified on Saturday, February 14, 2009 12:43 PM
|
|
|
|
|
Hi,
maybe msI is a stream you just filled with some data and forgot to reposition to the beginning of the data?
try adding msI.Position=0;
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:05 AM
|
|
|
|
|
Hi,
why is your subject line starting with "MySQL" while your code uses ODBC?
the solution to your problem is in this page[^], read all of it!
PS: don't disable statements by commenting them out, it makes your source unreadable.
the purpose of comments is to clarify things, not obfuscate them.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:06 AM
|
|
|
|
|
Thanks working great after replacing named parameter with a ?
and sorry for not putting every thing needed in the subject
line this was my first time posting on the forum
but i would like to as you one more question if you had 2 parameters
that you would wand to put in the same query how would go about doing that
and the commenting of code was done to show the implementation of the previous replays
|
|
|
|
|
hendrik wrote: Thanks
you're welcome.
hendrik wrote: if you had 2 parameters ...
then I would recommend you read this page[^] twice.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:06 AM
|
|
|
|
|
Luc Pattyn wrote: then I would recommend you read this page[^] twice. Big Grin
thanks i don't know how i mist that the first time
|
|
|
|
|
Hello, I have a problem on the table layout panel control. I wanted to create a program that on run time I could set the table layout panel's number of rows and columns. My Problem is that the spaces of each boxes on the table are not evenly distributed. How do I make it evenly distributed?
|
|
|
|
|
This code worked fine for columns, it can also be slightly modifed to fit for rows:
tableLayoutPanel1.ColumnStyles.Clear();
int numOfColumns = 4;
tableLayoutPanel1.ColumnCount = numOfColumns;
for (int i = 0; i < numOfColumns ; i++ )
{
ColumnStyle cStyle = new ColumnStyle();
cStyle.SizeType = SizeType.Percent;
cStyle.Width = 100 / numOfColumns;
tableLayoutPanel1.ColumnStyles.Add(cStyle);
}
|
|
|
|
|
Is possible to define mp3 format in SDP protocol ?
In examples i found only definition for various voice comunication or asf/wma format.
|
|
|
|
|
Hello, I have a DataGridView on a Windows Form , it has 3 columns, one of them is a CheckboxColumn, the other two columns are set to be automatically sortable.
The problem is that when I sort one of the sortable columns, the selected checkboxes in the CheckBox column are lost..
How can I keep the checked checkboxes checked after performing a sort on another column.
modified on Saturday, February 14, 2009 7:20 AM
|
|
|
|
|
If I populate a listview with somethinglike:
foreach (DebtorDataSet.DebtorListRow row in debtorDataSet.DebtorList.Rows)
{
ListViewItem item = listView.Items.Add(row.Code);
item.SubItems.Add(name);
item.SubItems.Add(row.IsPostcodeNull() ? "" : row.Postcode);
item.SubItems.Add(row.IsTelephoneNull() ? "" : row.Telephone);
}
How can I set the backcolor of a row to red if row.Telephone is null please?
|
|
|
|
|
Well, The method ListViewItem.SubItems.Add() can take a simple string to create a subitem, but it also can take a ListViewItem.ListViewSubItem object to do the same thing.
So, you can create ListViewItem.ListViewSubItem subitem, set its BackColor property to whatever you want, and then add it to the SubItems collection of your ListViewItem
ListViewItem.ListViewSubItem it1 = new ListViewItem.ListViewSubItem();
it1.BackColor = Color.Red;
item.SubItems.Add(it1);
|
|
|
|
|
hello...
my form has a static image like a photo of 100 computers. then my application pings the systems and if the destination is reachable then the corresponding computer must have a green light else a red one.
the problem is that the image has to be the same and only a part of it has to be changed,
i am thinking of doing this with the help of graphics in c# and would be pleased if any other methods work.... thank you .
|
|
|
|
|
|
|
hi evryone
how can i run WS in Win server 2003 ?
i need to make virtual directory to put there my WS file
but it give me only make Web to put there my WS file
what can i do ?
i make many WS that work on Win XP and all work excelent, whay in Win 2003
it dosent ?
thank's for any help
|
|
|
|
|
What is WS ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'll bet he means a "website". Been like this since Chris made us pay per character for each post. Text is expensive, so we need to cut down on the length of the messages.
I are troll
|
|
|
|
|
WS[^]
(I guess so)
|
|
|
|
|
Even an educated guess remains.. a guess
I are troll
|
|
|
|
|
i mean WebService, and i work in IIS in Windows server 2003
but i can't run my web service under IIS
|
|
|
|
|
E_Gold wrote: hi evryone
Helloes
E_Gold wrote: how can i run WS in Win server 2003 ?
Add it to IIS as an application.
E_Gold wrote: what can i do ?
Post an error-message here if you get stuck, or a specific question. Chances that someone will write a walkthrough are slim.
E_Gold wrote: i make many WS that work on Win XP and all work excelent, whay in Win 2003
it dosent ?
Because it's a real server-product, whereas XP isn't.
Checklist;
- Did you create a new application in IIS?
- Did you check the permissions?
- Did you install all required components?
Questions;
- Does the server work when you put a plain HTML file in the folder? Does it get served correctly to the browser?
- Can you run a simple aspx-file that only displays the current time, without too much login-logic and stuff?
I are troll
|
|
|
|
|
We have a webservice to send sms.We need to load the modem configuration during the initial startup of the webservice in the IIS.We need something similar to form load event in windows application.But in this case we have to load the configuration during the first time startup of the webservice in IIS.
Thanks in advance....
|
|
|
|
|
How about Application_Start in global.asax?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|