|
How to write code to install database into SQL Server ?
-- modified at 4:26 Tuesday 22nd May, 2007
|
|
|
|
|
What do you mean by install?
Do you want to create a database?
|
|
|
|
|
I think he means attaching a database
|
|
|
|
|
was it write a cookies?
if it was write a cookies,
How do write and read?
please give me directions, thanks.
|
|
|
|
|
Windows application or ASP.NET?
Windows application could be done several ways, you can write an encrypted file with all the login information, system registry(better not to), or store it in the application settings. I would suggest the first solution.
ASP.NET/ASP, then you would use cookies.
To do the reading/writing of a file, use FileStream , and StreamReader/StreamWriter .
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
I am using an xml and in that childnodes have one attribute which is optional, so that attribute may be present or not.
in front-end from c#.net 2005 i am reading that attribute, when it is not present it giving exception.
so how to find that there is no attribute for that childnode in runtime.
Thanks in advance
PraveenKumar Palla
|
|
|
|
|
Hello,
I think Reflection is what you are looking for.
The way from the object to the Attributes would be like this.
using System.Reflection;
Type t = yourObject.GetType();
foreach (PropertyInfo pi in t.GetProperties())
{
if(pi.PropertyType.Attributes & TypeAttributes.Serializable)
{
}
}
using System.Reflection;
Type t = yourObject.GetType();
object[] AllAttributes = t.GetCustomAttributes(true);
Hope it helps!
All the best,
Martin
|
|
|
|
|
just test for null. eg.
XmlDocument oXML = new XmlDocument();
oXML.LoadXml("<root><name id='1' value='ggg' value2='ttt'/><name id='2' value='erer'/></root>");
XmlNodeList nl = oXML.SelectNodes("//name");
foreach (XmlNode n in nl)
{
if (n.Attributes["value2"] != null)
{
}
}
|
|
|
|
|
when the below statement is executed then only getting exception(i.e. focusing to catch())
if (n.Attributes["value2"] != null)
|
|
|
|
|
Hi.
How do you do what I've already written in the title? Can it be done?
Thanks.
|
|
|
|
|
yourlabel.BackColor = System.Drawing.Color.Transparent;
|
|
|
|
|
Thanks, but for some reason it doesn't seems to work. I've placed my label on top of a ToolStrip, which has the basic gradient drawn on it. I've set the label's color to transparent, but it still shows the default grey(Control) color.
|
|
|
|
|
Problem with Transparency is that it shows the BackGroundColor of the Parent Control.
Which means if you change the BackColor of your Parent Control, you will see this color also at the Labals BackColor.
blackjack2150 wrote: I've placed my label on top of a ToolStrip, which has the basic gradient drawn on it
I don't know if I understand what you have done and what you whant to see.
Is the ToolStrip the Parent of your Label? (If this is possible!)
Is there a BackgroundImage involved or are you Drawing on your ToolStrip?
All the best,
Martin
|
|
|
|
|
|
Hello,
As I never worked with .Net>1.1 I'm not sure how the ToolStrip workes.
What I guess is, that the Label is in the same Container as the TollStrip, and it's just higher in the z-Order. (Brought to front)
I think this makes it impossible that the Label gettes the same gradient Background as the ToolStrip, It will allways show the Color of the ParentControl.
I think you have to write(paint) directly on the ToolStrip.
All the best,
Martin
|
|
|
|
|
I was afraid of that.
Anyway, it's not such a big deal and it's not worth too much effort. It will just fine in the present form, but it was just a curiosity of mine.
Thanks for your time. I appreciate it.
|
|
|
|
|
Glad I could help (In fact, by not really solfing the problem )
You are wellcome!
|
|
|
|
|
Help Help!
I've created an array of small picturebox's on a form, and want them to highlight when I click on them, but I don't know how to let the event handler method know which picturebox (which member of the array) ive clicked on...
See code below:
private PictureBox[,] lifeForms;
public coverForm(int dimX, int dimY)
{
InitializeComponent();
lifeForms = new PictureBox[dimX, dimY];
for (int y = 0; y < dimY; y++)
{
for (int x = 0; x < dimX; x++)
{
this.lifeForms[x, y] = new System.Windows.Forms.PictureBox();
this.paper[x, y] = lifeForms[x, y].CreateGraphics();
this.Controls.Add(lifeForms[x, y]);
lifeForms[x, y].BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
lifeForms[x, y].Location = new System.Drawing.Point((x*20)+4, y*20+4);
lifeForms[x, y].SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
lifeForms[x, y].Size = new System.Drawing.Size(20, 20);
lifeForms[x, y].Show();
lifeForms[x,y].MouseClick += new MouseEventHandler(this.selectDim_Click);
}
}
}
private void selectDim_Click(object sender, EventArgs e)
{
How can I read which picture box the user has clicked on down here?!!
}
Mark.
|
|
|
|
|
Hello,
The sender object is the instance of the pictureBox you whant.
You just have to cast it.
PictureBox actBox = sender as PictureBox
if(actBox!=null)
{
}
Hope it helps,
Martin
|
|
|
|
|
Thanks heaps guys I've got it working now... Legendary!!!
Mark.
|
|
|
|
|
You can assign tag to each picturebox and then find out which one was clicked by examining sender
|
|
|
|
|
Hello,
It's not neccessary to iterate threw the collection to find and compare the tag, and then find a member which is already passed by the event itselfe!
All the best,
Martin
|
|
|
|
|
You won't have to iterate through all the collection you just cast sender to picturebox and then examine its tag to see which one is it.
|
|
|
|
|
Sorry missunderstood your answer!
Giorgi Dalakishvili wrote: just cast sender to picturebox
That's what I answered before.
Giorgi Dalakishvili wrote: and then examine its tag to see which one is it
Why would you have to use a tag if you have the instance itselfe?
All the best,
Martin
|
|
|
|
|
If you are doing the same thing for every picturebox then you don't need but if it depends on which picturebox it is then you will need to examine tag. In this question I think only highlighting is needed and in that case you don't need but he also asked how to find out which picturebox was clicked. So if he is interested in which picturebox is the sender then he will need.
|
|
|
|