|
This is too close to being dangerous (aka virus creating)
I don't think you'll get an answer here.
|
|
|
|
|
ariyanna wrote: how we can change this result ?
It completely backs to your compiler. If you're writing C#, the compiler compiles your codes into MSIL (I think), If you're using Java, you have Byte Code after compiling. (Or I couldn't understand you well)
ariyanna wrote: we can do this ?
I don't think so. There's some converters by the way.
|
|
|
|
|
tanks to you all,
i don't think that i can get my answer here but if any one can introduce some sources for this subject i'll be glad...
|
|
|
|
|
Hi,
I have One DataGridView and One Button In Form.
I Form Load I Have Assigned DataSource To Datagridview by calling one function abc().
on button click i am adding search condtion to my select query.
abc function performs...
i am counting number of records Returned from the select query if it is not zero then i am assigning datasource........
now i want to clear the datagridview when no of records is zero.
how can we do this.
thanks in advance
|
|
|
|
|
set DataSource property of DataGridView to null
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Hi,
I was not sure where to list this so please excuse me if I have created this post in the wrong place.
I have a simple question, when will you employ the Facade Pattern? I mean I have checked it out and it's an excellent pattern but if you have say 10 classes and each class has 1000 methods why would you employ the Facade pattern? It seems to me that you are literally creating a single point of failure for your application.
It's probably a dumb question but I would like to know as this pattern seems like an excellent pattern to me but like ASP.NET AJAX, if you use it in the wrong place it will break your app - not make it better.
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: I mean I have checked it out and it's an excellent pattern
If you checked it out and decided it is an excellent pattern, surely you must have read where and why you would use it?
Illegal Operation wrote: if you have say 10 classes and each class has 1000 methods
Then you have a bigger problem that the Façade pattern will solve.
Illegal Operation wrote: It seems to me that you are literally creating a single point of failure for your application.
I don't understand what you are meaning by that. How is the Façade pattern a single point of failure?
There are various areas where you might use the Façade pattern. Most likely is that you have a large and unweildy interface into some subsystem and you want to create an easy interface to that system that hides some/most of the detail.
For example, a DAL (Data Access Layer) could implement the Façade pattern to hide the detail of ADO.NET operations. To the outside application you have a method that returns, say, customers. Behind the scenes the Façade is creating connections and SQL commands and so on. Now your main application doesn't have to deal with that detail any more. This makes your application cleaner to use and easier to maintain. And there is always the option to change what is behind the Façade without disturbing what is using the Façade (e.g. some time some decides that you really don't need SQL Server and that a bunch of XML files would be much better - Just think of all the code you'd have to change without the Façade. Now you change code in one place and everything else stays the same)
|
|
|
|
|
If there is something wrong with my original reply then let me know. Is there something I need to clarify? Is something I've not understood? Did I not answer the question? Let me know so I can be helpful. Voting it a 1* isn't helpful to anyone. It doesn't tell me why it isn't a good answer.
|
|
|
|
|
The Design and Architecture[^] section would be the best place for this question.
As Colin has pointed out, the Facade pattern is a great way to hide complexity. Basically, you use the facade to hide the detail of how multiple related operations are performed, so you introduce simplicity into your design.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi,
i used an object of date time and to be sure i fill it by hard code
and i tried to change it by add functions like AddYears() and the others
but it don't change i don't know where is the problem
i send two part of code the first one is the related code and the second is the whole
i appreciate your attention
the related code :
DateTime myDateTime = new DateTime(2007, 1, 1, 1, 1, 1);
MessageBox.Show("before:" + myDateTime.ToString());
myDateTime.AddDays(6);
myDateTime.AddYears(1);
myDateTime.AddMonths(4);
MessageBox.Show("after:" + myDateTime.ToString());
the whole function is :
private void settings_Load(object sender, EventArgs e)
{
myButtonClass1.dayOfWeek = 1;
myButtonClass2.dayOfWeek = 2;
myButtonClass3.dayOfWeek = 3;
myButtonClass4.dayOfWeek = 4;
myButtonClass5.dayOfWeek = 5;
myButtonClass6.dayOfWeek = 6;
myButtonClass7.dayOfWeek = 7;
myButtonClass8.dayOfWeek = 8;
myButtonClass9.dayOfWeek = 9;
myButtonClass10.dayOfWeek = 10;
myButtonClass11.dayOfWeek = 11;
myButtonClass12.dayOfWeek = 12;
myButtonClass13.dayOfWeek = 13;
myButtonClass14.dayOfWeek = 14;
myButtonClass15.dayOfWeek = 15;
myButtonClass16.dayOfWeek = 16;
myButtonClass17.dayOfWeek = 17;
myButtonClass18.dayOfWeek = 18;
myButtonClass19.dayOfWeek = 19;
myButtonClass20.dayOfWeek = 20;
myButtonClass21.dayOfWeek = 21;
myButtonClass22.dayOfWeek = 22;
myButtonClass23.dayOfWeek = 23;
myButtonClass24.dayOfWeek = 24;
myButtonClass25.dayOfWeek = 25;
myButtonClass26.dayOfWeek = 26;
myButtonClass27.dayOfWeek = 27;
myButtonClass28.dayOfWeek = 28;
myButtonClass29.dayOfWeek = 29;
myButtonClass30.dayOfWeek = 30;
myButtonClass31.dayOfWeek = 31;
myButtonClass32.dayOfWeek = 32;
myButtonClass33.dayOfWeek = 33;
myButtonClass34.dayOfWeek = 34;
myButtonClass35.dayOfWeek = 35;
myButtonClass36.dayOfWeek = 36;
myButtonClass37.dayOfWeek = 37;
myButtonClass38.dayOfWeek = 38;
myButtonClass39.dayOfWeek = 39;
myButtonClass40.dayOfWeek = 40;
myButtonClass41.dayOfWeek = 41;
myButtonClass42.dayOfWeek = 42;
Persian = new MyDateTime();
myPC = new PersianCalendar();
myHC = new HijriCalendar();
DateTime myDateTime = new DateTime(2007, 1, 1, 1, 1, 1);
String s;
s = "Shamsi: ";
s += myPC.GetDayOfMonth(myDateTime).ToString();
s += "-" + myPC.GetMonth(myDateTime).ToString();
s += "-" + myPC.GetYear(myDateTime).ToString();
s += "-" + myPC.GetDayOfWeek(myDateTime).ToString();
day.Value = myPC.GetDayOfMonth(myDateTime);
month.Value = myPC.GetMonth(myDateTime);
year.Value = myPC.GetYear(myDateTime) % 100;
Qday.Value = myHC.GetDayOfMonth(myDateTime);
Qmonth.Value = myHC.GetMonth(myDateTime);
Qyear.Value = myHC.GetYear(myDateTime) % 100;
Mday.Value = myDateTime.Day;
Mmonth.Value = myDateTime.Month;
Myear.Value = myDateTime.Year % 100;
s += "\n";
s += "Miladi:";
s += DateTime.Now.ToString() + "\n";
output.Text = s;
Persian.Year = (ushort) myPC.GetYear(myDateTime);
Persian.Month = (ushort)myPC.GetMonth(myDateTime);
Persian.Day = (ushort)myPC.GetDayOfMonth(myDateTime);
Persian.Hour = (ushort) myPC.GetHour(myDateTime);
Persian.Minute = (ushort) myPC.GetMinute(myDateTime);
Persian.Second = (ushort) myPC.GetSecond(myDateTime);
Persian.Milisecond = (ushort) myPC.GetMilliseconds(myDateTime);
second.Value = DateTime.Now.Second;
minute.Value = DateTime.Now.Minute;
hour.Value = DateTime.Now.Hour;
string Date = "";
Date += Persian.Day.ToString();
Date += " / ";
switch (Persian.Month)
{
case 1:
Date += "فروردين";
break;
case 2:
Date += "ارديبهشت";
break;
case 3:
Date += "خرداد";
break;
case 4:
Date += "تير";
break;
case 5:
Date += "مرداد";
break;
case 6:
Date += "شهريور";
break;
case 7:
Date += "مهر";
break;
case 8:
Date += "آبان";
break;
case 9:
Date += "آذر";
break;
case 10:
Date += "دي";
break;
case 11:
Date += "بهمن";
break;
case 12:
Date += "اسفند";
break;
}
Date += " / ";
Date += Persian.Year.ToString();
date.Text = Date;
MessageBox.Show("before:" + myDateTime.ToString());
myDateTime.AddDays(6);
myDateTime.AddYears(1);
myDateTime.AddMonths(4);
MessageBox.Show("after:" + myDateTime.ToString());
}
|
|
|
|
|
I suggest you get someone who is an englsh speaker to help rephrase your question - it did not make sense to me. I even read through your code hoping it would throw a ligh on your problem - what a mess.
Take a look at cultureinfo.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
According to the .Net Documentation of AddYears:
"This method does not change the value of this DateTime. Instead, a new DateTime is returned whose value is the result of this operation."
|
|
|
|
|
DateTime is immutable - it can't change. AddDays and the other functions return a new DateTime with the new value.
You should do
myDateTime = myDateTime.AddDays(6);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
DateTime.AddXXX creates a new DateTime object with the added value.
Use this:
DateTime myDateTime = new DateTime(2007, 1, 1, 1, 1, 1);
MessageBox.Show("before:" + myDateTime.ToString());
myDateTime = myDateTime.AddDays(6);
myDateTime = myDateTime.AddYears(1);
myDateTime = myDateTime.AddMonths(4);
MessageBox.Show("after:" + myDateTime.ToString());
|
|
|
|
|
Hey.
I've been searching relentlessly via the web for a solution to converting pcl files to pdf, but every SDK I've found requires payment and at no cheap cost so I now beg assistance via this forum.
I'm writing a Sharepoint activity that will convert pcl files to pdf.
Any assistance as to a solution would be greatly appreciated.
A dll or an sdk would be of great help.
Thanks in advance, Marco
|
|
|
|
|
Dear,
i have 10 questions in a form each question have 4 option.
i made 10 group box for each question and putted 4 radio button into each.
finally i have to calculate score of this test using a answer key.
what is the process for this .
(i am checking 40 radio button individually)
but it is not good if we have 100 question.
is there any solution ?....
thanks
|
|
|
|
|
Create a custom control to service a question. It needs to receive a question object, bind the controls to the object and bind the response to the answer in the object. When completed the object should write the result back to the database.
Then you just create one CC for each question and put it on the form. I would use a flowcontrol in winforms.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes sure. As Mr. Holmes said, you can have a CC for your questions but not a CC for each one. You can have a CC for all your questions. If I were you, my CC would have a Label and 4 RadioButtons in it and I would set their values with my CC constructor, something like this:
public myCC (string LabelValue, string[4] questions)
{
labelQuestion.Text = LabelValue;
radiobuttonQuestions.Texts = questions;
}
And everytime user clicks on Next button (or something similar) store the result in an array, create a new CC, set its values, show on your form and dispose the previous one. Your memory can breathe in this way
I hope I could help
I learned something new today
|
|
|
|
|
Hi,
I am using ODBC connection to execute a Stored procedure inside my C# project (visual studio 2008). I am passing a parameter and it is working fine except fewer parameter values. I tried to replace the SP by the exact query (used inside the SP) and it is working fine for all the parameter values. I dont understand why. Any one came across this problem? i cant find any forums relatd to this particular situation.
I got stuck here for more than 4 days now. Any help is highly appreciated.
Thanks a lot
Renu
|
|
|
|
|
Renukapadhamanaban wrote: I am passing a parameter and it is working fine except fewer parameter values.
What does that mean? Do you see fewer results than expected?
Also, how about posting the relevant code snippet?
|
|
|
|
|
You should explain your problem with SQL Query and what is the error message is show.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Hi Vikram and Anubhav,
Thanks a lot for the quick reply. Sorry for not explaining the problem clearly. here it is..
I have the Stored procedure written in sybase called PatientDetails
CREATE PROCEDURE PatientDetails2
(
@local_id VARCHAR (8)
, @facility VARCHAR (5) = 'RMH'
)
AS
SELECT lname = per.last_name, fname = per.first_name, mname = per.middle_name, per.title, dob = CONVERT(VARCHAR(10),per.dob,103)
, per.sex, per.mstatus, per.ssn, per.race, per.ethnic, per.religion, per.language, per.pob_country
, loc.facility, UR = loc.local_id
, pv1.visit_no, pv1.alternate_visit_id, pv1.admission_type, unit = pv1.hospital_service, ward = pv1.nurse_unit, pv1.room, pv1.bed
, admitted = pv1.admit_date_time, discharged = pv1.discharge_date_time, fin_class = pv1.financial_class
, admitting_dr = pv1.admitting_doctor, attending_dr = pv1.attending_doctor, consulting_dr = pv1.consulting_doctor, referring_dr = pv1.referring_doctor
, raddress1 = radr.address1, raddress2 = radr.address2, rcity = radr.city, rpostcode = radr.postal_code --residential
, maddress1 = madr.address1, maddress2 = madr.address2, mcity = madr.city, mpostcode = madr.postal_code --mailing
, hphone = hpho.phone --home
, bphone = bpho.phone --business
INTO #patients FROM ui_person per JOIN (ui_local_id loc
LEFT JOIN ui_pv1_segment pv1 ON (loc.local_id = pv1.local_id)
AND (loc.facility = pv1.facility))ON (per.u_id = loc.u_id)
LEFT JOIN ui_address radr ON per.u_id = radr.u_id
AND (radr.address_type = 'R')LEFT JOIN ui_address madr ON (per.u_id = madr.u_id AND madr.address_type = 'M')LEFT JOIN ui_phone hpho ON (per.u_id = hpho.u_id AND hpho.phone_type = '1') LEFT JOIN ui_phone bpho ON (per.u_id = bpho.u_id AND bpho.phone_type = '2')
WHERE loc.local_id = @local_id
AND loc.facility = @facility
RETURN
This works very fine for all the combination of the parameter values. I tested this in the AQL Advantage window.
Inside .NEt application i have written code to call this SP like this:
private DataTable PatientInformationRow(string ur, string facility, string procString) //procString=PatientDeatails2
{
OdbcConnection conn = new OdbcConnection(m_connString);
conn.Open();
OdbcCommand commDemo = new OdbcCommand();
commDemo.Connection=conn;
commDemo.CommandText="{call " + procString + "(?,?)}";
OdbcParameter urParam =commDemo.Parameters.Add("@local_id", OdbcType.VarChar);
urParam.Value= ur;
OdbcParameter facParam = commDemo.Parameters.Add("@facility", OdbcType.VarChar);
facParam.Value= facility;
OdbcDataAdapter daDemo = new OdbcDataAdapter(commDemo);
DataTable dtDemo = new DataTable();
try
{
daDemo.Fill(dtDemo);
}
catch(Exception e)
{
throw new Exception(e.Message);
}
conn.Close();
return dtDemo;
}
For example, If I pass the @local_id parameter value '123456', the SP works fine and returns the right patient record if I execute in the SQL advantage window and as well as through the .NET code. IF i pass '131534' it brings the right patient record if I execute in the sql advantage window but bringing no records through the .NET code. (this is what i specified as not working for fewer parameter values..) it is very weird..
I think i explained well... hoping for some help.
THanks in advance.
Renu
|
|
|
|
|
I am developing this tool specifically for our product. The product is called Process Expert. There are different blocks in which industrial process values are stored which in turn stores in mdb. A set of blocks is called a worksheet. In some blocks VB code is written to stablize the industrial process. I need to compare two different worksheets. I am able compare all the values, but I need to compare the VB code. If any body can help how to go about it, it will be helpful for me.
Regards
Surya
|
|
|
|
|
So... you are doing SCADA by embedding VBA into Access databases? I'm concerned.
|
|
|
|
|
Mark Churchill wrote: I'm concerned
Other than the choice of the toolset - why?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|