|
Hi,
Currently I use the following method in the presentation layer to capture the changes in a gridview control on a windows form:
DataSet data;
//Added records...
data = gridViewDataSet.GetChanges(DataRowState.Added);
//Modified records...
data = dsEmployeesList.GetChanges(DataRowState.Modified);
//Deleted records...
data = dsEmployeesList.GetChanges(DataRowState.Deleted);
So basically I loop through each record in the grid (In the presentatioin layer) and call the necessary stored procedures (in the datalayer) according to the state of the row.
This works fine.
My question is, there is no transaction.
So, should I stop using this method and use .update of DataAdapter or is there another method please?
I was thinking about transaction of connection but do not think I can use this in the presentation layer.
Hope you follow what I am asking.
Thanks
|
|
|
|
|
Hi, I'm having problem with hwo to get date.
I want to get a date of each end of the month in the current year.
so, if now is 2006 I want to get:
31 januari 2006, 28 Pebruari 2006 ....... 31 December 2006.
Then I want each date to be inserted into MySQL Table Field (with DATE type).
Thanks a lot for any helps.
Virtual Memory too low... thinkin' impossible
|
|
|
|
|
Hi,
You can try using DateTime.DaysInMonth(2006, 10);
Where first parameter is an year and second one is month. You can put int i and run the same function for 12 times.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Wow, that was fast response. And I tried that.
Thanx a lot !
Enjoy It!
|
|
|
|
|
just i want the code for reversing a string through an array.
|
|
|
|
|
Try doing this.
Array.Sort<string>(new string[] {"j", "a", "y", "a", "n", "t"});
Array.Reverse();
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
hi
you can do this:
<br />
String s = "the string to convert";<br />
char [] array = s.ToCharArray();<br />
char[] newArray;<br />
int count = 0;<br />
for (int i = array.Length - 1; i >= 0; i--)<br />
{<br />
newArray[count] = array[i];<br />
count++;<br />
}<br />
String newString = new String(newArray);<br />
there should be more flexibale methods.
but this came to my minde right now knowing that you have some conditions that it should be done using an array.
hope it helps best regards
|
|
|
|
|
quiteSmart wrote: array[i] = newArray[count];
Or perhaps the other direction...
---
b { font-weight: normal; }
|
|
|
|
|
Yea your right,
a small mistake.
i corrected it now
thanks
|
|
|
|
|
Try this...
string string1 = "String To Reverse";
string string2 = string.Empty;
StringBuilder sb = new StringBuilder();
char[] sArr = string1.ToCharArray();
for (int j = sArr.Length - 1; j >= 0; j--)
sb.Append(sArr[j].ToString());
string2 = sb.ToString();
|
|
|
|
|
string message = "!dlrow olleH";<br />
char[] temp = message.ToCharArray();<br />
Array.Reverse(temp);<br />
message = new string(temp);
---
b { font-weight: normal; }
|
|
|
|
|
nice and short
good work
|
|
|
|
|
If you want extra credit in the class, use recursion.
|
|
|
|
|
hi all,
this is my first mail to the forum...Plz let me know the answer for this ASAP.
here is my Problem:
public class R01Struct {
/// <remarks>
public AnImpositionType Annee;
/// <remarks>
public string NoReleve;
/// <remarks>
public R01StructIdentification Identification;
/// <remarks>
public Adresse2Struct Adresse;
/// <remarks>
public R01MntStruct Montants;
}
public class R01StructIdentification {
/// <remarks>
[System.Xml.Serialization.XmlElementAttribute("RaisonSociale", typeof(R01StructIdentificationRaisonSociale))]
[System.Xml.Serialization.XmlElementAttribute("Employe", typeof(R01StructIdentificationEmploye))]
public object Item;
}
public class R01StructIdentificationEmploye {
/// <remarks>
public string NAS;
/// <remarks>
public string No;
/// <remarks>
public string NomFamille;
/// <remarks>
public string Prenom;
/// <remarks>
public string Initiale;
}
there are two classes in one of my code files in my c#window application.my problem is i am trying to acces the content of the "R01StructIdentificationEmploye" by taking a varible of type R01Struct.
here is my old code when the identification class was not there.
((R01Struct)REL1.Items[i]).Employe.NAS = row["NAS"].ToString()"" ? "000000000" : row["NAS"].ToString();
pls give me the solution as soon as possible
vamsee krishna
|
|
|
|
|
Are you creating an instance of that class in your R01Struct contructor?
|
|
|
|
|
hi
I'm working a windows application project in C# and I was wondering how can we make or use icons for our application u know. It requires .ICO file and many softwares dont sopport making these so what should I do.
do u know of any site where some good icons are available or somethin like that
thanks in advance
Rocky
|
|
|
|
|
u can get it from any book of C# like of deitel,where code and idea is given to place information,exclamation,error and other icons on application.
|
|
|
|
|
AS a (bad) workaround, you can place a bmp is your resources and convert it into an icon:
Bitmap bmp = (Bitmap)resources.GetObject("myBMP.bmp");
IntPtr Hicon = bmp.GetHicon();
Icon newIcon = Icon.FromHandle(Hicon);
Then do what you want with it.
|
|
|
|
|
thats good but isnt there anyway we can make these icon files easily.
I'll try that surely...
thanks a lot
Rocky
|
|
|
|
|
I'm trying to implement message queuing in C# .net using MQSeries .. I have the Websphere server installed on a machine and i've tried implementing queuing on that machine .Local queuing without using channel information works fine on the machine where the server is installed .I tried installing MQ client on the client machine but it still is unable to connect.Everytime i try to connect to the system remotely and access the queues , i get an error saying dll not found.I tried to resolve this by copying all dlls frm the bin folder of the MQ client to system32 but that didnt help.
The exception is raised when the queue manager object is initialized . Even when i try to connect to the server from the same machine using channels ,it gives an MQRC_Environment_error .. or MQCONN error.Does anyone have a solution ??
Jake
|
|
|
|
|
I am Coming accross the problem "attempt to store an element of the incorrect type into the array "when i tried to add my UI during the design time.Please tell me what am i need to do overcome this problem.Thanks in advance
Regards,
Guru
|
|
|
|
|
Can you please be little more specific what exactly you want and what exactly you have done. Does problem mean exception? Try to exlplain in details, so that somebody can suggest right solution.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Too vague to help you. What exactly are you doing (include steps)? What is the exception that occurs?
|
|
|
|
|
what is virtual method,dynamic method,static method
|
|
|
|
|
What is homework ?
What is google ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|