|
Follow these steps :
1)- Splite the whole string "," and stored in Array
2)- Create an Array List
3)- Traverse the all items which is stored in step 1 and perform the below opetion
In Loop, again splile with "-" and pick the secod item every time and store in Arrya list which created in step 2
4)- Sort the array list which stored in step 3
5)- Pick the Max value (First index of arraylist)
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
HI,,
please can you help me by the code in c#??/
Thanks,,,
|
|
|
|
|
I have done coding for only max Numeric value..
string temp = "A1-50,A2-50,B1-50,B2-50";
String[] ar=temp.Split(',');
System.Collections.ArrayList arList = new System.Collections.ArrayList();
for (int i = 0; i < ar.Length; i++)
{
arList.Add(ar[i].Split('-')[1]);
}
arList.Sort();
MessageBox.Show(arList[0].ToString());
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
I want todays date in one textbox
and in another textbox 15days incremented
i have a Javascript code for getting date month Year
function addDate()
{
TheDate = new Date();
var theMonth = TheDate.getMonth();
var theDay = TheDate.getDate();
var theYear = TheDate.getFullYear();
if (document.getElementById('Text1').value == '')
{
document.getElementById('Text1').value = theDay + '/' + theMonth
+ '/' + theYear ;
}
else
{
document.getElementById('Text1').value = theDay + '/'
+ theMonth + '/' + theYear ;
}
}
I am unable to increment the date in second textbox
help me to solve this problem.
|
|
|
|
|
kiranreddy wrote: help me to solve this problem
You did not tell us your problem.
Also this suspiciously looks like web stuff and not C#, try the ASP.NET forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Use the getTime method to get the date in milliseconds, add the number of milliseconds in 15 days, and create a new Date object from the result.
Note that the month value is zero based, so you have to add one to get the one based value that humans use.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hello everyone,
i have a prop in displaying data from access database. i didn't under stand where i done mistake. i want to edit save data from database.when user enter emp_code and click edit button, then he displa all specific records related to that emp_id.
help me...!!
|
|
|
|
|
u could put some more info on wheres the problem with a sample code and more description...
Força Barça!
|
|
|
|
|
here is my code.....
for delete:-
private void button3_Click(object sender, EventArgs e)
{
conn.Open();
string command1 = "delete from employee where (emp_id = ? AND emp_code = ? AND emp_name = ? AND emp_address = ? AND emp_dob = ? AND emp_doj = ? AND emp_dor = ?)";
OleDbDataAdapter da = new OleDbDataAdapter(command1, conn);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
conn.Close();
}
for edit:--
private void button2_Click(object sender, EventArgs e)
{
conn.Open();
string sqlcom = "select emp_id,emp_code,emp_name,emp_address,emp_dob,emp_doj,emp_dor from employee where (emp_code=?)";
OleDbDataAdapter da = new OleDbDataAdapter(sqlcom , conn);
DataSet ds = new DataSet();
//ds.Clear();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
int a = Convert.ToInt32(ds.Tables[0].Rows[0]["emp_id"]);
textemp_id.Text = a.ToString();
}
else
{
MessageBox.Show("This E-Code does not exist");
}
conn.Close();
}
i am new in c#..this code is not working..if any change plz modify it.
Thanks
|
|
|
|
|
Hi all,
I have a windows application in client machine.I want to invoke(windows app screen should also be visible)that windows application(client machine) from server machine. Here both client and server machines are in LAN and WAN.
Problem:
1.Invoke the windows application(windows app screen should also be visible in client machine) from server machine.
2.After application opens in client machine,then user enters some data,that data have to be written to a file which is in server machine.
I succeeded to solve the above problem using webservices.
But suddenly I was asked to solve it using .net Remoting.....Iam new to .net remoting.
kindly help me in solving the above problem using .net Remoting.
|
|
|
|
|
Try MSDN, their documentations about .Net Remoting are fine.
Writing in Bold makes no sense. Please don't do that again.
Life is 5: 3 me, 1 you.
modified on Thursday, November 20, 2008 3:02 AM
|
|
|
|
|
And don't crosspost the same questions in multiple forums.
|
|
|
|
|
- Say, you have a running process and you want to know where's the file that initially launched it or..
- You have a locked file "because it is running as a process" and you want to kill its associated process to unlock that file.
Any idea or article dealing with that??
Thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
check the Process class, it can tell you all sorts of useful information.
for example:
foreach (Process p in Process.GetProcesses())
{
try
{
Console.WriteLine(p.MainModule.FileName);
}
catch (Win32Exception ex)
{
Console.WriteLine("caught an exception : " + ex.Message);
}
}
|
|
|
|
|
Thanks mate! That was helpful!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
hi have following table
student
id name school_ID
1 john 5
2 sara 2
3 luije 4
school
id name
1 area1
2 area2
3 area3
4 area4
5 area5
need to save "null" to school_ID with student ID(2)..??
thanks in advance
|
|
|
|
|
sounds like homework to me - what have you tried so far
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
var q = from d in sdc.student
where d.school_ID == 4
select d;
q.school_ID = null;
|
|
|
|
|
You cant make the primary key NULL!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
In your code, q is not a database row, but the query itself.
Also, you are not selecting on student id 2.
You should do something like this:
var q = from d in sdc.student
where d.id == 2
select d;
var row = q.FirstOrDefault();
if (row != null)
{
row.school_ID = null;
}
sdc.SubmitChanges()
|
|
|
|
|
ok, got it solve
but it is very straing
this not work:
-------
var q = (from d in sdc.student
where d.id == 2
select d).FirstorDefault();
try {if (q != null) q.school_ID = null;} cathc{ }
-------
following works:
int k = 0;
var q = (from d in sdc.student
where d.id == 2
select d).FirstorDefault();
try {if (q != null) k = 1/k;} catch { q.school_ID = null;}
---------------------------
Really don't know why when write this inside catch{} it works if write outside not work
Pleae check
Thanks
|
|
|
|
|
I don't see why this should not work.
What you mean by not work? Gives you an error, does nothing or what?
|
|
|
|
|
I've been using properties for quite some time, and it was until today that a question came to me: what's the difference between using a property and a variable? I know properties are better practice, but still... just wondering .
public int Number
{
get
{
return this.number;
}
set
{
this.number = value;
}
}
vs
public int number = 0;
|
|
|
|
|
You generally have more control over a property, but if you don't need that control then it's just overhead.
And have you looked at automatic properties (or whatever they're called)?
|
|
|
|
|