|
I'm afraid all of us misunderstood the question by missing the this in this.DialogResult=...
See my latest reply.
|
|
|
|
|
Sorry, I misread your question. My current answer is it closes by itself.
If the question is: When a dialog, while being shown, gets its DialogResult set, do I still need to close it explicitly?
Then I'd say NO.
Both MSDN and my little experiment indicate it closes automatically as soon as some value gets assigned.
There seems to be one exception: the value DialogResult.None does not close the dialog. This is not mentioned on the MSDN page on Form.DialogResult property, however it is somewhat mentioned on the page about DialogResult enumeration...
<
|
|
|
|
|
my project is massenger but how to create DB in server and access them u can tell me please
|
|
|
|
|
|
Didn't the teacher provide a starting-point? Which brand of database would you like to use?
I are Troll
|
|
|
|
|
First you must roll a six and call upon the Spirits of Query Languages to grant their blessing to call tables and relationships into being.
|
|
|
|
|
Your question is little bit confusing for me because you have no mention about which Database you want to create. Please be clear while you are posting your question.
|
|
|
|
|
I will develope eboard messenge use to learing and chatting as hotmail messenger but how to create email DB in server
|
|
|
|
|
hi
I have a code in C# and want to use the program in network. the network is WorkGroup and it uses the computers Windows username and password to connect each other. my SQLserver installed in windows Autentication.
my connectionString is like this:
<
<configuration>
<connectionstrings>
<add name="Budget.Properties.Settings.budgetConnectionString2"
="" connectionstring="Data Source=armansql-pc;Initial Catalog=budget;Integrated Security=True" providername="System.Data.SqlClient">
>
and now i can not find the problom. may i ask a help for a little guide?
|
|
|
|
|
Check your instance of SQL Server to see if the Browser Service is active. If it's not, it won't advertise its service on the network. Also - and this is getting vague for me, as I'm not an expert on SQL Server - I think there are limitations on how you address SQL Server. In a Workgroup you're probably using NetBIOS over TCP, which uses the common Windows resource name for a computer. I think that I recall reading somewhere that SQL Server requires a fully qualified domain name in the connection string. Of course, I could be full of sh*t, as I'm tired and fairly drunk, and I'm grasping at vague memories of things I found when I last tried to fix a SQL Server problem; my advice is worth everything it costs, and no more. But you might try looking into those two possible problem sources, nonetheless. [insert crosseyed smiley here]
Will Rogers never met me.
|
|
|
|
|
This site[^] usually helps me out.
FWIW: I've never needed a providerName
|
|
|
|
|
Dear Friends.
My problem is still remaining and i can not find any way for that.
is there any one have had similar problem Or have a sample of that?
its a simple WorkGroup Network and the computers can see each other. but why i cannot make the Connection String?
thanks for all
sincerely
|
|
|
|
|
navidsoft wrote: i can not find the problom
Neither can I, what are the symptoms?
|
|
|
|
|
Installing and using Windows Authentication in a Workgroup environment is a BAD idea. Since every machine in the workgroup, including the SQL Server maintains it's own list of user accounts and passwords AND DOES NOT TRUST ANY OTHER MACHINES ACCOUNT LIST, you are bound to have all kinds of login issues with the SQL Server. You're either going to have to use SQL Server accounts or change your entire network over to a domain setup where there is only ONE list of accounts and SQL Server uses that.
|
|
|
|
|
Hello,
I have an untyped parameter _target and the following code:
Type T;
List<object> olist;
IEnumerable<PropertyInfo> subProps;
olist.AddRange(resultSet.Select(result => GetO(T, subProps, result)));
prop.Info.SetValue(_target, olist.ToArray(), new object[0]);
I would have to write a lot of words, but I hope you understand what is the point after reading comments.
Before I posted this, I had came up with another idea:
Type t = ...;
dynamic olist =
typeof (List<object>).GetGenericTypeDefinition().MakeGenericType(new Type[] {t})
.GetConstructor(new Type[] {typeof(int)}).Invoke(new object[] {resultSet.Count});
IEnumerable<PropertyInfo> subProps = ...;
foreach (SparqlResult result in resultSet)
olist.Add(GetO(t, subProps, result));
prop.Info.SetValue(_target, olist.ToArray(), new object[0]);
I tried also using Convert.ChangeType but with no success.
What would be a working solution? An "anymous" cast would be good, like (type)object, but there is no such thing.
Thanks in advance,
Greetings - Jacek
|
|
|
|
|
I knew I'd have found an answer. I usually do. Eventually. After some time.
Array.CreateInstance was what I needed.
Type t;
List<object> olist;
IEnumerable<PropertyInfo> subProps;
olist.AddRange(...);
Array instance = Array.CreateInstance(t, olist.Count);
Array.Copy(olist.ToArray(), instance, olist.Count);
prop.Info.SetValue(_target, instance, new object[0]);
Greetings - Jacek
|
|
|
|
|
|
hey guys..i have my MdiChild form tabbed in main form..and when i right click on the tabpage i want to close the one was right clicked..to do that i drag-drop a context menu and i choose that context menu from properties of my tabcontrol and wrote that codes
private void sekmeyiKapatToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (DetayForm item in this.MdiChildren)
{
if (item.tbpg.Equals(tabControl1.SelectedTab))
{
item.Select();
item.Close();
item.tbpg.Dispose();
}
}
}
it works fine.but when i choose the first opened child form and try to close it all child forms are closed and it close all again when i right click not selected tab..what can i do?
vemedya.com
|
|
|
|
|
hey again. i solved my problem like below.i found below code in web but i didnt understand exactly what GetTabRect() does?
private void tabControl1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
for (int i = 0; i < this.tabControl1.TabCount; i++)
{
if (this.tabControl1.GetTabRect(i).Contains(new Point(e.X, e.Y)))
{
this.tabControl1.SelectedIndex = i;
break;
}
}
}
}
private void sekmeyiKapatToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (DetayForm item in this.MdiChildren)
{
if (item.tbpg.Equals(tabControl1.SelectedTab))
{
item.Close();
break;
}
}
}
vemedya.com
|
|
|
|
|
When you don't know what something does, MDSN is the first place to look :GetTabRect method[^]
A simple Google "GetTabRect MSDN" will find it for you...
MSDN says "Returns the bounding rectangle for a specified tab in this tab control." which means it returns a Rectangle which contains the Tab part (on the tab list, has the text describing the tab).
|--------|-----------\
| My Tab | Other Tab |
|-----------------------------------|
| |
| |
| My Tab Content |
| |
| |
| |
|-----------------------------------| It would return the rectangle containing "My Tab", but not "Other Tab" or "My Tab Content"
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Hello,
I would like to translate arithmetical operation to executable ASCII code.
I mean to find the ascii of '+' operator (lets say it's stored in tmp), and then to execute this operation like
int result += num1; but in the next order int result tmp= num1;
is it possible ?
Thanks
|
|
|
|
|
|
hello all i am facing a problem that i do not know how to solve so i'm seeking advise here
private void button2_Click(object sender, EventArgs e)
{
try
{
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
if (open.ShowDialog() == DialogResult.OK)
{
pictureBox2.Image = new Bitmap(open.FileName);
textBox2.Text = open.FileName.ToString();
Bitmap DatabaseImage = new Bitmap(pictureBox2.Image, 320, 240);
pictureBox2.Image = DatabaseImage;
}
}
catch (Exception)
{
throw new ApplicationException("Failed loading image");
}
}
How do i use the DatabaseImage in another button instead?
|
|
|
|
|
If You Declare Any Variable in the Event or method ...
That variable will be only accessable in that event or method..
i.e. Scope of that varialble is limited to that mentod of event..
If you want to use any variable(i.e same variable ) in more than two events declare it outside of the scope of menthod.
means declare it in you class
i.e
class abs
{
declare Here variables;or assgn values
method1()
{
}
method2()
{
}
}
so that you can use same variable value in method1 and method 2
In your case databaseImage Variable(Bitmap) is declared in button2_click()
so you can only acces it within button2_click()
Declare databaseImage above all methods and use it in button1_click() as wel as Button2_click().
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
{
try
{
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
if (open.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = new Bitmap(open.FileName);
textBox1.Text = open.FileName.ToString();
Bitmap finalImage = new Bitmap(pictureBox1.Image, 320, 240);
pictureBox1.Image = finalImage;
}
}
catch (Exception)
{
throw new ApplicationException("Failed loading image");
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
if (open.ShowDialog() == DialogResult.OK)
{
pictureBox2.Image = new Bitmap(open.FileName);
textBox2.Text = open.FileName.ToString();
Bitmap DatabaseImage = new Bitmap(pictureBox2.Image, 320, 240);
pictureBox2.Image = DatabaseImage;
}
}
catch (Exception)
{
throw new ApplicationException("Failed loading image");
}
}
private void button3_Click(object sender, EventArgs e)
{
}
I want to make use of finalImage and DatabaseImage in button3_Click event how shld i go abt it? i tried declaring above all emthod but it dont seems to be working.
}
|
|
|
|