|
That´s the problem I guess, I don´t know what the right format is.
|
|
|
|
|
how can get today closing balance opening tomorrow or month using asp.net c# and sql2005 is it possible
|
|
|
|
|
Probably by explaining where these values are stored, and how you access them.
Use the best guess
|
|
|
|
|
sir
I store value in database SQL 2005 and reflect it on web form on month basis to text box with using ASP.net
|
|
|
|
|
Probably better to use an ATM. Or explain your problem properly, with information about your database scheme/object model.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
protected void Drp_Breed_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox47.Text = Drp_Breed.SelectedItem.Text;
//Drp_Breed.Items.Insert(0, "----------");
{
general objGen = new general();
DataSet ds2 = new DataSet();
string q2 = "select distinct cl_bal_young_m,cl_bal_young_f,cl_bal_adult_m,cl_bal_adult_f from AHD_09 where District='" + Drp_District.SelectedItem.Text + "' and SDVH_VPC='" + Drp_VH.SelectedItem.Text + "' and VH_CVD_Others='" + Drp_CVD.SelectedItem.Text + "'and VD='" + Drp_VD.SelectedItem.Text + "' and Other_Institution='" + Drp_Other.SelectedItem.Text + "' and name_breed='" + Drp_Breed.SelectedItem.Text + "' and name_breed='" + TextBox47.Text + "' and Date='" + DateTime.Now.AddMonths(0).Date.ToString() + "'";
SqlCommand cmd = new SqlCommand(q2, conn);
ds2 = objGen.que_exe(q2);
////District='" + Drp_District.SelectedItem.Text + "'and
conn.Open();
if (ds2.Tables[0].Rows.Count > 0)
{
TextBox1.Text = ds2.Tables[0].Rows[0]["cl_bal_young_m"].ToString();
TextBox2.Text = ds2.Tables[0].Rows[0]["cl_bal_young_f"].ToString();
TextBox3.Text = ds2.Tables[0].Rows[0]["cl_bal_adult_m"].ToString();
TextBox4.Text = ds2.Tables[0].Rows[0]["cl_bal_adult_f"].ToString();
}
conn.Close();
|
|
|
|
|
Modify your original question, and remember to format your code using the "code" button please. It'll make it easier to read and you'll get more help.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
you are not giving enough information / code snippets to help.
How are you storing the data? (structure and very small sample data would help!).
From the little information given I would suggest that you look at either LINQ sum() method or if you are using ADO.NET and T SQL I would then have a look at the SUM(columnName)
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
protected void Drp_Breed_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox47.Text = Drp_Breed.SelectedItem.Text;
//Drp_Breed.Items.Insert(0, "----------");
{
general objGen = new general();
DataSet ds2 = new DataSet();
string q2 = "select distinct cl_bal_young_m,cl_bal_young_f,cl_bal_adult_m,cl_bal_adult_f from AHD_09 where District='" + Drp_District.SelectedItem.Text + "' and SDVH_VPC='" + Drp_VH.SelectedItem.Text + "' and VH_CVD_Others='" + Drp_CVD.SelectedItem.Text + "'and VD='" + Drp_VD.SelectedItem.Text + "' and Other_Institution='" + Drp_Other.SelectedItem.Text + "' and name_breed='" + Drp_Breed.SelectedItem.Text + "' and name_breed='" + TextBox47.Text + "' and Date='" + DateTime.Now.AddMonths(0).Date.ToString() + "'";
SqlCommand cmd = new SqlCommand(q2, conn);
ds2 = objGen.que_exe(q2);
////District='" + Drp_District.SelectedItem.Text + "'and
conn.Open();
if (ds2.Tables[0].Rows.Count > 0)
{
TextBox1.Text = ds2.Tables[0].Rows[0]["cl_bal_young_m"].ToString();
TextBox2.Text = ds2.Tables[0].Rows[0]["cl_bal_young_f"].ToString();
TextBox3.Text = ds2.Tables[0].Rows[0]["cl_bal_adult_m"].ToString();
TextBox4.Text = ds2.Tables[0].Rows[0]["cl_bal_adult_f"].ToString();
}
conn.Close();
but it show only next month after insert value
|
|
|
|
|
first thing I would suggest is that you
1. put a break point on the SQL string q2
2. after stepping over it have a look at the SQL and run it in your database, does this give you the results that you are expecting?
3. purely is a nit pick I would look into having SQL Parameters, but do this after you have sorted out the exisitng query
SQL Parameters example[^]
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I am new to learn WPF and MVVM design pattern, beginner for both. So can anyone suggest me the tutorials for WPF and MVVM design pattern in C# with examples.
Thanks in advance.
|
|
|
|
|
|
Thanks Rechard for your prompt reply.
I visited this link, but don't identify from where to start as a beginner. I just want to make clear some basic understanding and idea of WPF & MVVM. After that I will go to these links for little bit more clear about its aspects.
Once again thanks.
|
|
|
|
|
|
Thanks Rechard for your reply.
|
|
|
|
|
I'm supposed to write a very simple program to display, "A, B, C (and a sentence I forgot already)".
The catch is, we're supposed to use the Unicode instead of the string literals for A, B, C.
I know the Unicode for the A character, the book I'm reading uses its Unicode as an example.
I went backwards and forwards in my book a few chapters, nowhere in it does it explain or give an example on how it got that Unicode for the capital letter A.
I new how to display the data type of a variable with:
<pre lang="c#">
Console.WriteLine(x.GetType);
</pre>
Is there a similar enumeration to find the Unicode?
(Did I use enumeration in the right context here? Trying to learn the lingo as I go.)
|
|
|
|
|
If you know the Unicode value for "A", then you can work out the rest quite easily; just by adding 1 to the value for each successive letter up to "Z". And if you need the value for any of the less common characters then the Windows Character Map application will show them to you.
Use the best guess
|
|
|
|
|
I thought about that… But, because I'm in the beginning stages of learning C#
I wanted to be sure, instead of just jumping right in.
Thanks.
PS-it would be nice to know how to convert a literal character to Unicode programmatically.
<a href="http://www.widmarkrob.com">My Coding Journey</a>
|
|
|
|
|
WidmarkRob wrote: it would be nice to know how to convert a literal character to Unicode programmatically. A literal character in C# is already a Unicode value, you just need to use a cast to get that value. For example:
char strCharacter = 'Q';
Console.WriteLine(strCharacter);
int value = (int)strCharacter;
Console.WriteLine(value);
Console.WriteLine("{0:X}", value);
Use the best guess
|
|
|
|
|
Okay, I'm missing something somewhere…
<pre lang="c#">
Console.WriteLine("\u0041");
</pre>
That Prints out to the Console Window:
A
LOL, when I change 41 into 82 it gave me the:
?
<a href="http://www.widmarkrob.com">My Coding Journey</a>
|
|
|
|
|
|
\u0041
what does that exactly mean?
"\u0041"
Unsigned?
Some sort of unsigned datatype?
I'm learning, I haven't learned that much yet.
I have a book on C# that I'm reading.
Whenever they try to explain something, it doesn't always think in… So, I do a Google search to try to find answers.
There must be a specific enumeration of the type char that I'm missing somewhere.
Or, Method… Is a better word than enumeration?
<a href="http://www.widmarkrob.com">My Coding Journey</a>
|
|
|
|
|
WidmarkRob wrote: what does that exactly mean? "\u0041" This is merely a way of representing a Unicode character by its hexadecimal value. If you look at the Windows Character Map application it shows you the hexadecimal value for each Unicode character. You can also see similar values for the ASCII character set. It may be that you need to get hold of a reference book that explains how data is held and represented in digital computers, and how it can be converted from one type to another. More information can also be found at http://www.unicode.org/faq/utf_bom.html[^].
Use the best guess
|
|
|
|
|
Is there any built in method (.Net C#) to convert the unix time (double datatype) to datetime?
I got the following code from Stackoverflow :
public static DateTime UnixTimeStampToDateTime( double unixTimeStamp )
{
// Unix timestamp is seconds past epoch
System.DateTime dtDateTime = new DateTime(1970,1,1,0,0,0,0);
dtDateTime = dtDateTime.AddSeconds( unixTimeStamp ).ToLocalTime();
return dtDateTime;
}
But it's not working properly. The above method returns 1970-01-01 00:00:00 as result.
Thanks.
here is the Stackoverflow link:
http://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa[^]
|
|
|
|
|
I don't see how that will work since you are adding a double value to an integer one, which means you lose all the precision. You would first need to convert the time portion of the Unix value into an integer number of seonds. Try some of these links[^].
Use the best guess
|
|
|
|