|
|
I have a string variable which contain UniCode string as its value.
when i am printing it on console with writeline method, it showing "?" on the screen instead of original string.
can any one tell me, how can resolve problem.
Bugs Never Die
-- modified at 8:19 Monday 22nd May, 2006
|
|
|
|
|
You can convert it to ASCII :
Encoding srcEncoding = Encoding.Unicode;
Encoding tgtEncoding = Encoding.ASCII;
byte[] byteInUnicode = Encoding.Unicode.GetBytes("your string");
byte[] byteInAscii = System.Text.Encoding.Convert(srcEncoding, tgtEncoding, byteInUnicode);
string strInAscii = Encoding.ASCII.GetBytes(byteInAscii);
|
|
|
|
|
FileStream xsdStream = new FileStream(@".\XMLSchema\AuthenticateUser.xsd", FileMode.Open);
this line is not getting executed when i try to run this using virtual directory. why it is so
ItsMe
|
|
|
|
|
What do you mean by "not getting executed"? Is there an error? What is the exception message? Is it doing nothing at all?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi,
I'm having a situation like this.
I am using a datagridview which fills up Item details from a table, say Items.
I am also adding a Datagridcomboboxcolumn to this datagrid whose datasource is table 'Category' from where it should show various category names in combo box for user to select one.
I can see the datagridview being filled up with data from Items table.I can also see the combo box column being generated for each row.However, the combobox doesnot work and show any values from its datasource.
How can I show rows from one table and combo box in each row from other table in a datagridviw ?
here is the pseudocode :
DataTable dt = objItems.GetItems(); // gives Item details in a table.
DataTable dtCat = objCat.GetCategory(); // returns category details in form of a table.
dgItems.DataSource = dt; // dgItems is a datagridview created with the help of toolbox on a winform.
DataGridViewComboBoxColumn comboColumn = new DataGridViewComboBoxColumn();
comboColumn.DataPropertyName = "CategoryDesc";
comboColumn.HeaderText = "Select Category";
comboColumn.MaxDropDownItems = 5;
comboColumn.DataSource = dtCat;
comboColumn.ValueMember = "CategoryId";
comboColumn.DisplayMember = "CategoryDesc";
dgItems.Columns.Insert(dt.Coulmns.Count + 1, comboColumn);
Thanks in advance.
Nikita
|
|
|
|
|
i want code for simple search and advance search
|
|
|
|
|
Search for what?!?!?
|
|
|
|
|
BOSS What u wants to search....
Anuj Kamthan
|
|
|
|
|
|
What do you want to search ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi to all,
can anyone give me a head start on following problem(i've made the same post in the VB.Net post section):
I have an applications in which I add controls to a treeview (treeview = container). The problem is that when i scroll my treeview, the nodes move but the controls stay at their place ( the don't move in other words). ANy idea on how to make them move and keep their raltive position (now they are located next to the node which handles as the controls label)
kind regards,
Bats (Mike Martin)
|
|
|
|
|
You must handle scroll events, and recalculate location of each control.
Best regards, Alexey.
|
|
|
|
|
|
hi
i want use combobox into datagrid and bind datasource to an fild of database..
how to do that ?
thanks..
|
|
|
|
|
In this search[^] are several atricles which might fit for you.
|
|
|
|
|
Hi All,
I want to represent data stored in xml file in the form of a tree in a web page using C#.....how can i achieve this???
Looking forward for help
Regards,
|
|
|
|
|
See this example :
using System;
using System.IO;
using System.Xml.Serialization;
namespace ConsoleApplication10
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
SerializeToXML();
DeserializeFromXML();
}
static void SerializeToXML()
{
XmlSerializer xs = new XmlSerializer(typeof(MyDataClass));
MyDataClass mdc = new MyDataClass();
mdc.A = 10;
mdc.S = "Hello World";
mdc.D = new double[3];
mdc.D[0] = 0.456;
mdc.D[1] = 1.234;
mdc.D[2] = 4.234;
Stream writer = new FileStream("test.xml", FileMode.Create);
xs.Serialize(writer, mdc);
writer.Close();
}
static void DeserializeFromXML()
{
XmlSerializer xs = new XmlSerializer(typeof(MyDataClass));
Stream reader= new FileStream("test.xml",FileMode.Open);
MyDataClass mdc = (MyDataClass) xs.Deserialize(reader);
Console.WriteLine(mdc.A);
Console.WriteLine(mdc.S);
for(int i = 0; i < mdc.D.Length; i++)
{
Console.WriteLine(mdc.D[i]);
}
}
}
public class MyDataClass
{
private int a = 0;
private string s = "";
private double[] d = null;
public int A
{
get { return this.a; }
set { this.a = value; }
}
public string S
{
get { return this.s; }
set { this.s = value; }
}
public double[] D
{
get { return this.d; }
set { this.d = value; }
}
}
}
|
|
|
|
|
thxx sir i ll use this code
Regards,
|
|
|
|
|
hi all,i have a checkbox in header template of the grid i don't know how to find that checkbox is checked or not.anybody can help me to solve this problem?pls......
ayyp
|
|
|
|
|
Hi,
In OnDataItemBound event you can find that control after checking for the Itemtype.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i didn't get u, can u say in detail
ayyp
|
|
|
|
|
Hi,
OnItemDataBound event you can first check for the itemtype if it is a header then you can find the control inside that. Something like this:
if(e.Item.ItemType==ListItemType.Header)
{<br />
CheckBox chk = (CheckBox)e.Item.FindControl("kaus");<br />
chk.Checked=true;<br />
}
Hope this will help.
Best Regards,
Apurva Kaushal
|
|
|
|
|
k thanks
ayyp
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|