Click here to Skip to main content
16,018,249 members

Comments by richa11 (Top 14 by date)

richa11 6-Aug-14 3:30am View    
I know this very well but we get some sample project in this forum.I am asking for some sample code for this not whole project.
Its not urgent for anyone but its urgent for me.If you don't want to help just ignore it why are you giving comments?
richa11 17-Jun-14 0:13am View    
yes i have lastUpdatedTime in my database and from that I want to calcilate
richa11 8-Jun-14 11:31am View    
I used parameterized query also but again exception..

public void InsertRecord(int i)
{
int RFStatus = Convert.ToInt16((i % 2 == 0) ? RefundStatus.Dispute : RefundStatus.DisputeRes);
Random rnd = new Random();
long XUID = rnd.Next(1, 100);
String myDateTime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss.fff");
DateTime LastUpdateTime = DateTime.Parse(myDateTime);

SqlConnection cnn = new SqlConnection("Data Source=WN7-CDDGMV1\\SQLEXPRESS;Initial Catalog=RefundsDB;Integrated Security=SSPI");
cnn.Open();
String str = @"insert into [dbo].[CustomerInfo] (RefundID,UserXUID,RefundType,RefundDate,
RefundDeniedReason,DisputeCustData,CustomerEmail,CustomerName,Currency,Country,
Refund,FraudRuleStatus,RefundStatus,DisputeStatus,AllowComments,LastUpdatedTime) values(@RefundID,@UserXUID,@RefundType,@RefundDate,@RefundDeniedReason,@DisputeCustData,@CustomerEmail,@CustomerName,@Currency,@Country,@Refund,@FraudRuleStatus,@RefundStatus,@DisputeStatus,@AllowComments,@LastUpdatedTime) ";
SqlCommand cmd=new SqlCommand(str,cnn);
cmd.Parameters.AddWithValue("@RefundID", null);
cmd.Parameters.AddWithValue("@UserXUID",XUID);
cmd.Parameters.AddWithValue("@RefundType", null);
cmd.Parameters.AddWithValue("@RefundDate", DateTime.Now);
cmd.Parameters.AddWithValue("@RefundDeniedReason", null);
cmd.Parameters.AddWithValue("@DisputeCustData", null);
cmd.Parameters.AddWithValue("@CustomerEmail", null);
cmd.Parameters.AddWithValue("@CustomerName", null);
cmd.Parameters.AddWithValue("@Currency", null);
cmd.Parameters.AddWithValue("@Country", null);
cmd.Parameters.AddWithValue("@Refund", null);
cmd.Parameters.AddWithValue("@FraudRuleStatus", null);
cmd.Parameters.AddWithValue("@RefundStatus", RFStatus);
cmd.Parameters.AddWithValue("@DisputeStatus", null);
cmd.Parameters.AddWithValue("@AllowComments", null);
cmd.Parameters.AddWithValue("@LastUpdatedTime", LastUpdateTime);
cmd.ExecuteNonQuery();
}

Whats wrong?
richa11 6-Mar-14 8:33am View    
static void Main()
{
int[] ar = { 8, 5, 3, 5, 8, 5, 2, 1 };
int temp;
int count = 1;
int[] temparr = new int[ar.Length];
for (int i = 0; i < ar.Length; i++)
{
for (int j = i + 1; j < ar.Length; j++)
{
if (ar[i] < ar[j])
{
temp = ar[j];
ar[j] = ar[i];
ar[i] = temp;
}
}

}
for (int i = 0; i < ar.Length; i++)
{
Console.WriteLine(ar[i]);
}
Console.WriteLine("--------------");
for (int i = 0; i < ar.Length; i++)
{

for (int j = 1 ; j < ar.Length; j++)
{
if (ar[i] == ar[j])
{
count++;

}
if (count > 1)
{
temparr[i] = count;

}
count = 1;

}
}
Here is my code,
richa11 6-Mar-14 8:28am View    
I have sorted the array in descending order but not able to print the maximum ocurrence