|
can't understand what r u saying??
|
|
|
|
|
Well, you run your code, yes?
It does something, yes?
What exactly it does do only you can see. (Remember that we can't see your screen, access your HDD, or read your mind, so we only get to work with what you tell us.)
So without knowing what it should do: "There are 15 male students, 12 female" and what it actually does do: "It shows 6 Male and 140 Female students" we don't have much to go on in the way of information.
We can't run your code and get the same results you do, because we don't have access to your database. So you need to tell us the information we can't find out any other way.
If you rang the garage and said "my car broke" you would expect them to want information like "what broke?", "where is it?", "was it the engine?", "have you run out of fuel?", and so forth, so why would you expect us to be any different?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It doesn't show any number there is nothind no text on the label
|
|
|
|
|
No text at all? Ok.
You also said: "I want to show the total number of male students in label names Sm and i don't get it!!"
Which is possibly wrong because your code puts Male Teachers in there:
this.SM.Text = "" + Male_teachers.ToString() + "";
That means the code above isn't executed at all - because int.ToString cannot return an empty string - it will always return a number as a string, even if that number is zero.
So, if that code isn't being executed, and since you don't say that you get a MessageBox or a fatal exception, the most likely is that you aren't calling the Summary method at all. And a quick look at your code says you aren't calling it anywhere in the code fragment you showed us. If you don't call it, you don;t get any displayed values.
Did you mean to call it from your Form1_Load event handler perhaps?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
thank u sooooooo much u helped me alot
|
|
|
|
|
You're welcome!
(Just remember in future - the better the info you give us, the quicker we can give you a solution! )
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Tell your teacher that although it is allowed to have spaces in a table-name, and although it is supported, and even with it being merely an example and an excercise -
IT IS NOT DONE.
..and then I'd expect not to see the term "records" appended to that name. What else is going to be in there, icecream and zombies?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I was using IMultiValueConverter in my project in which I will be doing some business calculations. for this I will be using the following.
1. An DataTable
2. An XML and,
3. Some coloring logic.
I am trying to apply color for some cells in the DataGrid by performing an business calculation using the above mentioned together or any one of it. In all the cases am getting some lagging (slowness) in applying color to the deserved cell. but if I simply return color without performing an business calculation it works fine (So am sure that there is no mistake in applying or the way I integrated IMultiValueConverter) which means I was not calculating any business logics using the above mentioned things.
My Question was is there is any limitation in using IMultiValueConverter and IValueConverter in such a way that it was not overloaded with response time to the control to which it was bounded?
Note: please let me know if any one can't understand my question
_AKA_KSN_
|
|
|
|
|
_AKA_KSN_ wrote: In all the cases am getting some lagging (slowness) in applying color to the deserved cell. but if I simply return color without performing an business calculation it works fine (So am sure that there is no mistake in applying or the way I integrated IMultiValueConverter) It also proves that it's calculating the business logic that causes the slowdown.
_AKA_KSN_ wrote: My Question was is there is any limitation in using No, it's the business logic.
The UI-thread is responsible for drawing the UI, and it's a bad idea to put some BL in a presentation-layer.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
But we found a different cause for this problem, in my DataGrid we have enabled Virtualization and some common theme. when we disable those it works fine.
which mean the Ui takes long time to load the data and renders all the values in the UI. after that we don't need Convertors any more. so we planned to fix the bug in theme and have to do some enough study in enabling virtualization.
_AKA_KSN_
|
|
|
|
|
_AKA_KSN_ wrote: But we found a different cause for this problem, in my DataGrid we have enabled Virtualization Virtual Mode does not slow down the grid; on the contrary, it's used when databinding is too slow.
_AKA_KSN_ wrote: which mean the Ui takes long time The UI-thread is there to paint a UI, not to load data or do conversions.
_AKA_KSN_ wrote: have to do some enough study in enabling virtualization. There's a walkthrough here[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
It sounds to me like you are solving the wrong problem here. Rather than attempting to do business calculations in converters, you should create a ViewModel and perform your calculations in there. One of the overheads you have in a converter is that all elements are treated as objects, so you have unboxing to cope with.
|
|
|
|
|
hi, I use below code to create/consume and dispose sql connections.But as there are more than twenty methods/functions that I use it, same code block repeats. So, is it goog practice? Your valuable comments are welcomed.
private void islemKayitlariniYukle(string select)
{
using (SqlCeConnection sqlCEBaglantisi = new SqlCeConnection(Properties.Settings.Default.sqlBag))
using (SqlCeDataAdapter sqlAdaptor = new SqlCeDataAdapter(select, sqlCEBaglantisi))
using (DataTable dtTablo = new DataTable())
{
sqlCEBaglantisi.Open();
sqlAdaptor.Fill(dtTablo);
SqlCeCommand islemTipleriniAl = new SqlCeCommand("Select IslemTipi From IslemKaydi Group By IslemTipi", sqlCEBaglantisi);
using (SqlCeDataReader oku1 = islemTipleriniAl.ExecuteReader())
{
while (oku1.Read())
{ cmbIGIslemTipiSec.Items.Add(oku1.GetString(0).Trim()); }
}
|
|
|
|
|
teknolog123 wrote: same code block repeats. You could wrap some things in their own method
teknolog123 wrote: So, is it goog practice? Not if you're religious about the DRY-principle. In that case, there'd be a factory to return an IDbConnection , and the query-string would be passed to a method containing the database-connection logic.
Still, with or without the repeating code; I could work with it. If you'd use English names for your variables, I might even be able to understand it's intention
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks let me explain more. I just want to dispose sqceConnection, sqlceCommand, SqlCeCommandBuilder and sqlceAdapter as soon as I finish processing the data. for example does the below code dispose the objects in that manner? I think no but wanna make sure. (note: I didn't use sqladapter and commnadbuilder below to keep the code short on purpose)
public SqlCeConnection sqlSetCon()
{
SqlCeConnection sqlCon = new SqlCeConnection();
sqlCon.ConnectionString = Properties.Settings.Default.sqlConnStr;
sqlCon.Open();
return sqlCon;
}
public DataTable returnDataTable(string selectString)
{
SqlCeDataAdapter sqlAdaptor = new SqlCeDataAdapter(selectString, sqlSetCon());
SqlCeCommandBuilder sqlKomut = new SqlCeCommandBuilder(sqlAdaptor);
DataTable dtTablo = new DataTable();
sqlAdaptor.Fill(dtTablo);
return dtTablo;
}
private void processList()
{
using (DataTable dt = returnDataTable("Select * From Customers Order By Surname"))
{
for (int i = 0; i < dt.Rows.Count; i++)
{
this.lblSurname.Text = dt.Rows[i]["surname"].ToString();
}
}
}
modified 2-Feb-14 6:38am.
|
|
|
|
|
Something similar to below; wrap the disposable's in a using-section, and they'll be disposed when they go out of scope.
public DataTable returnDataTable(string selectString)
{
using (var con = sqlSetCon())
using (SqlCeDataAdapter sqlAdaptor = new SqlCeDataAdapter(selectString, con))
{
DataTable dtTablo = new DataTable();
sqlAdaptor.Fill(dtTablo);
return dtTablo;
}
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks Eddy, by the way, is it only those that are written in parentheses disposed or anything in curly braces?
|
|
|
|
|
teknolog123 wrote:
thanks Eddy, by the way, is it only those that
are written in parentheses disposed or anything in curly braces?
Anything that's disposable would be best in a using -clause. You can try it by putting it in a using, if it's not disposable you'll get a compiler-error saying so. Alternatively, you can check MSDN.
If you can't limit it to a scope, then you'd best dispose it from code later.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
how to use Switch Startup Project extension in visual studio 2012
|
|
|
|
|
You mean other than download it[^], install it, and follow the instructions on the page you got it from?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Actually ive downloaded from that site only , but i.e for VS2010,
do u have any idea that is there any extension for VS2012
|
|
|
|
|
The site doesn't list any different download, but does list 2012 and 0213 in the compatibility list.
So have you enabled it? Displayed the toolbar / toolbar item?
If so, then you probably need to talk to the author: there is a Q&A tab on the page.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
What problem are you having installing, or using, it ? [^].
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
problem in using ,
i installed but i.e is not appearing on Visual Studio
NOTE:I am using Visual studio 2012,
i didnt find any where that Extension for 2012
|
|
|
|
|
Hi Dear Friends;
Want to ask a question about SqlDependency.
C # sql operation with SqlDependency in my side I want to see.
Example:
I got 2 MSSQL database,
are the first data in my database.
When you take action in the first database, Current Data I want to add my second database.
SqlDependency with the insert, update, delete, how do you find out the line?
I use the sample code I'm writing.
When you take action on this sql code can trigger windows form.
I'm asking transactions which took place in line?
I'm sorry for bad english.
#region Using directives
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.Data.SqlClient;
#endregion
namespace NotifySample
{
partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SqlConnection con;
SqlCommand cmd;
SqlDependency dep;
SqlDataAdapter da;
DataTable dt;
private void btnVeriCek_Click(object sender, EventArgs e)
{
con = new SqlConnection("data source=localhost;initial catalog=Dukkan;integrated security=SSPI");
con.Open();
cmd = new SqlCommand("Select DetayID,PersonelID,Ad,Soyad,Mail From dbo.PersonelDetay", con);
dep = new SqlDependency(cmd);
SqlDependency.Start("data source=localhost;initial catalog=Dukkan;integrated security=SSPI");
dep.OnChange+=new OnChangeEventHandler(dep_OnChange);
da = new SqlDataAdapter(cmd);
dt = new DataTable();
da.Fill(dt);
dgVeriler.DataSource = dt;
}
void dep_OnChange(object sender, SqlNotificationEventArgs e)
{
MessageBox.Show("THIS AREA SQL INSERT, UPDATE, DELETED WANT TO SEE DATA");
}
}
}
|
|
|
|
|