|
I want to read the xml data from the sql server 2005 by using
vb.net
I have xmltest table in datatbase and the data column which has the xml datatype
but I have a code of reading the xml data as follows
conn.Open();
SqlCommand command = conn.CreateCommand();
System.Text.StringBuilder builder = new
System.Text.StringBuilder();
command.CommandText = "SELECT XmlDesc FROM XmlTest WHERE ID = " + ID.ToString();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
1)how to use in vb.net ?
-----> SqlXml sqlXmlValue = reader.GetSqlXml(0);
XmlReader xmlReader = sqlXmlValue.CreateReader();
while (xmlReader.Read())
{
2) How to use in vb.NET
---> builder.Append(xmlReader.ReadString());
builder.Append(" ");
}
txtXmlDesc.Text = builder.ToString();
}
else
txtXmlDesc.Text = "No Value";
now I want to convert this code in to vb.NET
what shoud I use at 1 and 2 ?
insted of SQLXml which is in c# what should I use in vb.net ?
|
|
|
|
|
nileshbahirshet wrote: insted of SQLXml which is in c# what should I use in vb.net ?
SqlXml is a .NET class not specific to C#. IMO stick with C#, VB is dead and VB.NET is a poor attempt to keep VBers relevant.
only two letters away from being an asset
|
|
|
|
|
language: C#
I am trying to set a no. of pictureboxes containing an image( image being a transparent image) of its own. Is there any way to set these pictureboxes over one another so that the image of one picturebox below another picturebox can be seen( as the images set over them are transparent)????
|
|
|
|
|
You can't do this with pictureBoxes - even though the image contains transparent areas, the pictureBox will only show the background colour of the parent control (or anything you paint manually in the PaintBackground event of parent control). You may have better luck doing the painting yourself rather than relying on pictureBox - this will give you more control over what happens when you layer images like this.
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
I agree with the previous poster,
It would be better to have a list of images in your form and to draw them all to a single picture box inside the PictureBox Paint event handler.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
The best thing you can do is layer these images in memory, and then write the combined image into a single picturebox.
|
|
|
|
|
Hi,
if you want to operate on images and don't know how to do it with a PictureBox, then it is very
likely a PictureBox is not the right Control for the job. Consider using a Panel, and paint whatever
it is you need in its Paint handler.
|
|
|
|
|
can a panel open multiple images together.... if not then how to do it.. as i have more than 1 no. of transparent images to open ???
if yes.... then i'll go forward with it.....
Thank you all for replying....
|
|
|
|
|
A Panel is a simple container, it is like a whiteboard with size, location, backcolor, etc.
but it does not do anything; you have to load the images yourself and paint what you want to see.
IMO Panel gets sufficiently explained in MSDN.
|
|
|
|
|
Hello to all,
I want to conferm that Is it possible to create a 16 bit application in .Net. I need 16 dll or application because I want to create a dll for 16 bit application.
Please help me how to solve this problem.
thanks
|
|
|
|
|
No.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You already asked this question in another forum. The only thing this will accomplish is getting you ignored.
only two letters away from being an asset
|
|
|
|
|
asp.net radio button list can access single button with some value?
1)rdb1
2)rdb2
3)rdb3
is in group(rdblist).
if i choose rdb1 then i want to calculate value in text box, how?
|
|
|
|
|
You want to make calculation in Javascript or on page postback??
Regards
Aman Bhullar
|
|
|
|
|
Hi Guys,
I'm using the validation block (4.1) + ErrorProvider and have them integrated with my WinForms app properly, however, i can't find the setting that enables re-focusing on validation fail. i.e. when validation fails you can't currently move to the next control.
I'd like to run all my validation on a button click, rather than on a per control basis, but keep the red exclamation marks.
Any idea how to do this?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
As i am new in the XMl world
I want to discuss the following steps
1) I wan to read the xml file
2) after reading I have to bind that file to propoertyGridControl box
3) Afetr filling the data by user into that property grid contol
I have to Store that data into database(SQL server 2005)in single column ( XML dtat Type)
4) after storing the data Next time when user loads that
Propoerty grid cotrol I have to bind that data to property grid
Now I want to know that
1)from above senario I have to use XML as document format or like storage type
( As I want to store and again bind to grid)
2) What is the struuctrue I have to follow to save in database so
I can read agin that xml from database and bind to grid ?
Ex.
Is
<emp>ABC
<age>33
Valid ? to store in database as it is ?
3) Which query I have to fire to get exact same structure to get from DB ?
4) How can I read the XML using Dataset(in VB.NET) and bind to grid ?
5) How can I use the SQLCommand objext to read xml data and bind to grid ?
Is there Typecasting reaquire ?
|
|
|
|
|
|
There are lots of tutorial avilable on net.Google it.There is a training kit by Microsoft .Purchase it .They also provide a CD,simulation of Exam.
Cheers!!
Brij
|
|
|
|
|
Seriously?? Buy a book[^] for it.
If you can't figure out how to start studying for a test, how are you going to start a software project??
|
|
|
|
|
Hi ,
I am new in .NET technology...
I have a XML file containing following data...
<?xml version="1.0" encoding="utf-8">
<MyData>
<EmployeeName>aaa</EmployeeName>
<age>25</age>
</MyData>
Now,I want to simply store this into databse(SQL server 2005)using VB.NET
and I want to retrive same data and bind to grid...
How can I do this ?
|
|
|
|
|
Don't post the same question, even if th title is changed
You have a number of options. You could store the document in a database table with the column of type text or xml and use an XmlDataSource object to bind it to your control. You could also store the content of the xml file as individual columns in a database table and bind your grid to a datatable.
only two letters away from being an asset
|
|
|
|
|
Thanx buddy,
but i have still some issue..
I have created the table call XMLTest into database
in which I have two fields
PKID-Integer datatype
Data-XML datatype
While storing the xml data into database whether I have to put the line
<?xml version=""1.0"" encoding=""utf-8"">
at start of the data
or not ?
|
|
|
|
|
It doesn't matter. Have you at least tried it before asking?
only two letters away from being an asset
|
|
|
|
|
Hi...
I have try it
I have store the data into databse in following format...
(orignal data in file)
<mydata>
<employeename>aaa
<age>21
I store the following data using this code
dim xmldata = <mydata><employeename>aaa_ <age>21
SqlConnection.Open()
Dim cmd As New SqlCommand("insert into xmlTest Values(62,'" & xmldata & "')", SqlConnection)
cmd.ExecuteNonQuery()
MessageBox.Show("Record Saved Succsessfully")
SqlConnection.Close()
it stores sucsessfully
but after executing the following query I get the this data...
Select * from xmlTest for xml auto
I get this data after firing the query on that row of SQL server
<xmltest pkid="62">
<mydata>
<employeename>aaa
<age>11
befor going to ask about retriving the data first tell me
whether I am storing the data in right format or not ?
|
|
|
|
|
Hi...
I have try it
I have store the data into databse in following format...
(orignal data in file)
<xml version="1.0" encoding="utf-8">
<MyData>
<EmployeeName>aaa</EmployeeName>
<age>21</age>
</MyData>
I store the following data using this code
dim xmldata = <?xml version="1.0" encoding="utf-8">_
<MyData><EmployeeName>aaa</EmployeeName><age>21</age></MyData>
SqlConnection.Open()
Dim cmd As New SqlCommand("insert into xmlTest Values(62,'" & xmldata & "')", SqlConnection)
cmd.ExecuteNonQuery()
MessageBox.Show("Record Saved Succsessfully")
SqlConnection.Close()
it stores sucsessfully
but after executing the following query I get the this data...
Select * from xmlTest for xml auto
I get this data after firing the query on that row of SQL server
<xmlTest PKID="62"> <-------------------------------table name and PKID
<data> <-------------------------------Column Name of Table
<MyData>
<EmployeeName>aaa</EmployeeName>
<age>11</age>
</MyData>
</data>
</xmlTest>
befor going to ask about retriving the data first tell me
whether I am storing the data in right format or not ?
|
|
|
|