|
Sorry I didnt get your idea
how can i get the value of
would you explaine more.....
in my Resource file i have this tags
<value>Ok
<comment>button Ok
<value>0,0
<comment>button Ok
<value>75, 23
<comment>button Ok
|
|
|
|
|
Is this an xml-file? Okay let us assume your file looks like this:
<br />
<resources><br />
<item><br />
<tag1>OK</tag1><br />
<tag2>button OK</tag2><br />
<!-- button2 --><br />
</item><br />
<item><br />
<tag1>0,0</tag1><br />
<tag2>button OK</tag2><br />
<!-- button2 --><br />
</item><br />
<item><br />
<tag1>75,23</tag1><br />
<tag2>button OK</tag2><br />
<!-- button2 --><br />
</item><br />
</resources><br />
Then you can get the first comment with (with itemNode is set to the first node with the tag item):
<br />
string b = itemNode.SelectSingleNode("./comment()[1]").InnerText<br />
Does this help you?
Regards
Sebastian
|
|
|
|
|
Thanks a Lot !!!!!!!!!!!!!!!
it was great help to me
|
|
|
|
|
You can't get this value as far as I know. You can put this value in a hidden label, than get this value.
modified 27-May-14 5:05am.
|
|
|
|
|
Hello,
I have a problem:
I want to draw a line between object A (Say an ellipse) and object B (also an ellipse). Now, between those object lies object C (which is a triangle). Now how can I draw the shortest line between A and B avoiding object C, using GDI+?
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
In two steps:
1) Solve the mathmatical formula to determine the line's endpoints
2) Draw the line
I can't tell from your question which of the two steps you need help with, but it seems like you are asking for help with step 1. If you already know how to do step 2, then this is the wrong forum to ask your question as part 1 is not C# related.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I have a datatable(code behind datatable class) that contains a column with the name aa which have ulphanumeric values.
Is there any way to find those rows having numeric values onlywithout doing iteration ?
|
|
|
|
|
The Select method of the DataTable class allows you to do just that, using pseudo T-SQL.
It returns an array of DataRow .
E.g.:
DataRow[] results = yourDataTable.Select("aa=15");
var question = (_2b || !(_2b));
|
|
|
|
|
Thanks for replying..
Greg Chelstowski wrote: DataRow[] results = yourDataTable.Select("aa=15");
I have to check it at runtime, and there is no static value as written by you in query. the datatable can have any number of both numeric, alphanumeric records.
Please suggest something.
|
|
|
|
|
abcurl wrote:
I have to check it at runtime
???
abcurl wrote: and there is no static value as written by you in query
Then use variables. And by static I'm sure you meant hard-coded.
abcurl wrote: the datatable can have any number of both numeric, alphanumeric records.
Use single quotes in the query then!
Now, once you actually got your DataRow array, I'm sure you'll be asking next how to extract values from it. Look, do some reading on MSDN, there are a million tutorials and examples on the .Select method of DataTable.
var question = (_2b || !(_2b));
|
|
|
|
|
If possible try to use the Regex. May be it helps solving your problem.
|
|
|
|
|
I use below code for add picture to dataBase but if I need that insert null instead of picture into database the program give me Error (I set allowNull for column in Sql)
(it's neccesary becuase maybe user dosen't have picture for insert into database)
how can I do that?
MemoryStream mstr = new MemoryStream();
pictureBox1.Image.Save(mstr, pictureBox1.Image.RawFormat);
byte[]pic= mstr.GetBuffer();
SqlConnection sq=new SqlConnection(...);
SqlParameter sp1 = new SqlParameter("@pic", pic);
SqlCommand sc = new SqlCommand("insert into Info values(@pic)", sq);
sc.Parameters.Add(sp1);
sc.ExecuteNonQuery();
|
|
|
|
|
Hi,
could you post the error you receive (message etc.)? Maybe your db-schema doesn't allow null-values for the picture column.
Regards
Sebastian
|
|
|
|
|
I set allowNull for that column
|
|
|
|
|
And the error you receive is?
|
|
|
|
|
Error : parameter @pic, which was not supplied
|
|
|
|
|
Try to pass
<br />
System.DBNull.Value<br />
as parameter value when pic1 is null.
|
|
|
|
|
Error : Operand type clash: nvarchar is incompatible with image
|
|
|
|
|
There's your problem right there. nvarchar is a text based field, and you are trying to store an image in it - you need to change the column type in the database, or save the image to disk and store the location of the image in this field.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi, try the following code, it may help you.
int len = Upload.PostedFile.ContentLength;
byte[] pic = new byte[len];
Upload.PostedFile.InputStream.Read (pic, 0, len);
SqlConnection sq=new SqlConnection(...);
SqlCommand cmd = new SqlCommand ("insert into values(@pic)", sq);
cmd.Parameters.Add ("@pic", pic);
cmd.ExecuteNonQuery ();
modified 27-May-14 4:59am.
|
|
|
|
|
hi, try the following code, it may help you.
int len = Upload.PostedFile.ContentLength;
byte[] pic = new byte[len];
Upload.PostedFile.InputStream.Read (pic, 0, len);
SqlConnection sq=new SqlConnection(...);
SqlCommand cmd = new SqlCommand ("insert into values(@pic)", sq);
cmd.Parameters.Add ("@pic", pic);
cmd.ExecuteNonQuery ();
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 9:00am.
|
|
|
|
|
How can I use DataBase without attach ?
I want to write a program and use sql how can I Insert,... data to sql without attach database file ?
|
|
|
|
|
Hi,
what do you mean by 'attach'?
Regards
Sebastian
|
|
|
|
|
attach means not attaching dB file just put It in program's directory and use it like SQLEXPRESS
|
|
|
|
|
So you want to use the db file (sql-express) without attaching it to the server? Well I think this is not possible. But you could use another database like derby etc. which can be used without an existing server...
|
|
|
|