|
Hi
Can any one tell me how to check for the end of row condition in the data base table using c#.
Is there any function like Movenext() to fetch next row values from the table?
|
|
|
|
|
Ashraj1982 wrote: Can any one tell me how to check for the end of row condition in the data base table using c#.
Is there any function like Movenext() to fetch next row values from the table?
It all depends on how you are getting the data out of the database in the first place.
It sounds like you are using a DataReader. The DataReader.Read() pulls in the next row from the database. It returns true if a row was fetched or false if there are no more rows.
Does this help?
"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
|
|
|
|
|
Use :
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.textbox.Text = resources.GetString("Key1");
In your resource file, you must add -> Key1 = HelloWorld (for example).
|
|
|
|
|
I added first line of code to form1.designer.cs and have the text control retrieve the string.
but when debugging, the string doesn't show on the form designer.
What am i missing?
|
|
|
|
|
If you can retrieve the string, that means your problem is not in ResourceManager.
That must be at another place in codes.
|
|
|
|
|
I want to create charts dynamically using excel template. How can I set default characteristic to all the charts creating in this way? Please help urgent.
|
|
|
|
|
Try start recording macro in excel, and do manualy all actions you want.
Then look at the code of macro - and convert this code to C#.
Best regards, Alexey.
|
|
|
|
|
1) Is there a method for counting number of .xls files in a directory?
2) What is the best way to check if excel is installed on system?
|
|
|
|
|
1 - Directory.GetFiles ( from memory )
2 - probably checking some registry key.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
1)
int num = Directory.GetFiles("directorypath", "*.xls").Length;
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
|
Hi all,
can any one help me out in "How to restrict to paste text into a text box"
Please help me
Ravi Kumar Neelam
|
|
|
|
|
|
hi all,
i have two forms (named form1 and form2).
i call form2 from form1. when doing this, i hide form1.
but i want to show form1 again if form2 is closed.
how can i show form1 by form1.show ?
do i have to implement the following ???
form1 xyz=new form1();
xyz.show();
i dont want to create a new form1 instance just want to call the one i hide before ...
someone told me "Make sure that form2 has a way to reference form1 though."
how do i do this ? help me please ...
thanks in advance.
bye,
|
|
|
|
|
Simply register to the FormClosed event of form2 and inside the event handler make your form1 visible again:
form2 x = new form2();
x.FormClosed += new FormClosedEventHandler(this.Form_FormClosed);
this.Visible = false;
x.Show();
...
void Form_FormClosed(object sender, FormClosedEventArgs e)
{
this.Visible = true;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:03am.
|
|
|
|
|
Did you actually try to adapt what I gave you in my first post. It's not that hard:
on form1 :
if ((textBox1.Text == "admin") && (textBox2.Text == "xxx"))
{
Form2 mehmet = new Form2();
mehmet.FormClosed += new FormClosedEventHandler(this.Form_FormClosed);
mehmet.Show();
this.Visible = false;
}
...
void Form_FormClosed(object sender, FormClosedEventArgs e)
{
this.Visible = true;
}
Nothing to do on form2
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Yes... you must have a reference of form1 in form2.
If you create form2, you must edit the constructor of form2.
Form1 form1 = null;
public Form2(Form1 form1)
{
this.form1 = form1;
}
private void form2_Closed(object sender, EventArgs e)
{
this.form1.Visible = true;
}
And then in form1, if you create the form2, you must use this code :
Form2 form2 = new Form2(this);
form2.ShowDialog();
|
|
|
|
|
If you have a reference of form1 in form2, you can call anything in form1, but you must set the method/property in form1 to PUBLIC.
There are 2 possibilities, whether you create a new property or set your textbox to public.
e.g.
public string MyTextbox
{
get { return this.textbox.Text; }
set { this.textbox.Text = value; }
}
private void ChangeTextInForm1()
{
this.form1.MyTextbox = "Hello World Again";
}
|
|
|
|
|
How to throw soap exception. Can u give an example
ItsMe
|
|
|
|
|
Just throw any exception in the web service. It will be sent as a soap exception to the caller.
---
b { font-weight: normal; }
|
|
|
|
|
No if i tend to access this web method in windows application i wont get the error in soap class. i need to explicitily specify using soap exception class i think
ItsMe
|
|
|
|
|
I've got something like this
String[] thing = {"name", "number"}
int count = 0
for (count < 3; count++)
{
String command = "this." + thing[count];
command = input.readline();
}
this.name and this.number are datatypes I've created and need to dynamically get access to to create entries. Unfortunatly I dont know how to get c# to use command literally, rather then just overwrite the string.
Anyone got this figured out? Thanks!
|
|
|
|
|
Reflection is your friend:
for (int count = 0;count < thing.Length; count++)
{
FieldInfo info = this.GetType().GetField(thing[count], BindingFlags.NonPublic);
info.SetValue(this, input.readline());
}
Note that with BindingFlags.NonPublic I assume that both variables are declared private. If not, take a look at the help for the GetField method and the BindingFlags enumeration and you should be able to figure out what needs to be changed.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Hi folks.,
i have capture the live video by using DirectX.Capture application (got from Codeproject) but now i have a problem with Auto Tuning channels.
is there any one face like this plz share with me.
Thanks & Regards
ranandbe
|
|
|
|