|
dear donto get upset read following link i am sure it will help you
<a href="http://www.beansoftware.com/ASP.NET-Tutorials/ProgressBar-User-Control.aspx">http://www.beansoftware.com/ASP.NET-Tutorials/ProgressBar-User-Control.aspx</a>[<a href="http://www.beansoftware.com/ASP.NET-Tutorials/ProgressBar-User-Control.aspx" target="_blank" title="New Window">^</a>]
If You Get your answer then please Rating me...
Thanks..
"Are You Ready"
DX-ARMY
|
|
|
|
|
hi.........
i have written code in windows application as follows
app.config
<connectinsring>
<add name="Employee.Properties.Settings.EmpdetailsConnectionString"
="" connectionstring="Data Source=SPARK1\SQLEXPRESS;Initial Catalog=Empdetails;Integrated Security=True;Pooling=False" providername="System.Data.SqlClient">
program.cs
string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(conString);
but it gives error like
1. The name ConfigurationManager Des not exist.
pls help me.......
|
|
|
|
|
Now this is a properly worded question, you have givens us some code, and told us what is wrong. You still need to add the <pre> tags though.
1) You need to reference the System.Configuration dll in your project. (Right click "References", "Add Reference", select the ".Net" tab then select System.Configuration in the list and OK it.
2) Add using System.Configuration; to the top of the file containing your class.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Thanks a lot.......
this will run but their is an another error is
1.a field initializer can not reference the non static field ,method,property,"EmpDetails.form.conString"
code is:
string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(conString);
|
|
|
|
|
Hi,
I suggest you move the assignments (conString and con) to the Form's Load handler.
|
|
|
|
|
hi.......
I have display datagridview.Pls give me the code of ,when i insert the record into database at that time displaying updated datgridview.
|
|
|
|
|
jadhavshubhangi wrote: me the code of
We are not here to do you job for you, just to help if you have a question. Also this is, I assume a repost.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
make a one function in which the data table or data set is bind into the grid view....
after updation call the function immediately... then you will get your updated grid view..
If You Get your answer then please Rating me...
Thanks..
"Are You Ready"
DX-ARMY
|
|
|
|
|
hi........
the code is
con.ConnectionString = "Data Source=SPARK1\\SQLEXPRESS;Initial Catalog=Empdetails;Integrated security=true";
con.Open();
//int p = Convert.ToInt32(dataGridView1.SelectedRows);
String s = "Select * from Empdetails where EmpId=";
SqlCommand cmd = new SqlCommand(s, con);
SqlDataReader dr = cmd.ExecuteReader();
//dataGridView1.DataSource = dr;
//GridView1.DataBind();
while (dr.Read())
{
txtempid.Text = dr.GetInt32(0).ToString();
txtname.Text = dr.GetValue(1).ToString();
txtaddress.Text = dr.GetValue(2).ToString();
combodes.Text = dr.GetValue(3).ToString();
txtphno.Text = dr.GetInt32(4).ToString();
}
dr.Close();
cmd.ExecuteNonQuery();
con.Close();
}
|
|
|
|
|
a) You've posted code, but not formatted it. in <pre> tags
b) You haven't said what is or is not happening that needs to be fixed.Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
hi.........
the code is
con.ConnectionString = "Data Source=SPARK1\\SQLEXPRESS;Initial Catalog=Empdetails;Integrated security=true";
con.Open();
//int p = Convert.ToInt32(dataGridView1.SelectedRows);
String s = "Select * from Empdetails where EmpId=";
SqlCommand cmd = new SqlCommand(s, con);
SqlDataReader dr = cmd.ExecuteReader();
//dataGridView1.DataSource = dr;
//GridView1.DataBind();
while (dr.Read())
{
txtempid.Text = dr.GetInt32(0).ToString();
txtname.Text = dr.GetValue(1).ToString();
txtaddress.Text = dr.GetValue(2).ToString();
combodes.Text = dr.GetValue(3).ToString();
txtphno.Text = dr.GetInt32(4).ToString();
}
dr.Close();
cmd.ExecuteNonQuery();
con.Close();
|
|
|
|
|
Congratulations! You win the prize for posting the most useless post of the day!
Exactly the same as the post you were criticised for, but missing one closing curly bracket!
Well done - and thanks for listening! You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
you may not be the smartest guy in town, but at least you are consistent.
|
|
|
|
|
"A foolish consistency is the hobgoblin of little minds" - R W Emerson.
I think it applies quite well to this questioner. Judging by his other posts, he is trying to punch well above his programming weight...You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Hi guyz.
I am writing a parental control system. This is a C#.NET executable ParentalController.exe and is started as System.Diagnostics.Process.Start. The app is working fine but i don't want the children to stop the ParentalController.exe from Task Manager. I have tried a solution in which another app (guard.exe) is guarding the ParentalController.exe but i dont like this solution theoritically because a clever child can stop both the executables. So i am looking for a solution in which the child just cannot stop the application and its guardian from Task Manager. However the administrator (Parent) can stop both executables.
I hope i have explained the problem properly. Please help me.
Thanks
|
|
|
|
|
If the ParentalController.exe is run under an Admin account, and the children are logged on as Users, they can't kill that process using Task Manager, right?
|
|
|
|
|
Thanks calla !
I am going to try your solution. But how to make a process run under admin account
|
|
|
|
|
You could run it as a Windows Service and choose to run it under LOCAL SYSTEM.
If you start it using System.Diagnostics.Process.Start then use the signature that takes a user name and password as well.
Check this link[^] out.
|
|
|
|
|
Hi, yes initially it was a windows service but then i made it a simple executable. I am going to use the signature solution now. A big thank you to you....
|
|
|
|
|
Hi,
I have only been using C# for a few weeks now and have recently found the following code and adjusted it to read a text file on my PC. It appears to be working as it is printing all of the data as expected to the screen in the following format;
3869;
4758;
7890;
9943;
and so on;
I would like to ask what is the best way to find the nearest value within the .txt file that is above another value. Let's say in the case the value is 4991 then I would like to return the value of 7890 only.
{
readText = File.ReadAllText("C:\\PIn.txt");
string [] split = readText.Split(new Char [] {';'});
foreach (string s in split)
{
count++;
levels[count] = int.Parse(s);
}
Print(readText);
}
As a newbie I really appreciate the help so thank in advance,
suprsnipes
|
|
|
|
|
When you read each value in your file, first check if the value you read is greater than the value you are interested in (in your example 4991). In case it is: calculate the difference between that number and 4991 and store the number and the result in memory in case it is the smallest difference so far. And just loop through all the numbers. In code something like this:
int num = 4991;
int tmp, res = 0;
int? diff = null;
foreach (string s in split)
{
count++;
tmp = int.Parse(s);
levels[count] = tmp;
if (tmp > num)
{
if (diff == null)
diff = num;
if ((tmp - num) < diff)
{
res = tmp;
diff = tmp - num;
}
}
}
Console.WriteLine(res);
Could probably be done in a better way, but you get the idea.
Good Luck!
|
|
|
|
|
|
|
Hi Everyone, I got a question,
I am very much fond of using
string fileContent = File.ReadAllText(fileName)
to read a file. But I found many programmers are using
StreamReader objReader = new StreamReader(fileName);
string fileContent = objReader.ReadToEnd();
objReader.Close();
So, my question, which option is better ? I mean, in what case, I should prefer to use StreamReader over File.ReadAllText() ?
|
|
|
|