|
|
It is as simple as reading alphabets,
static void Main(string[] args)
{
string strInput = "('1213,1415')";
strInput = strInput.Trim(new char[] { '(', '\', ')' });
IList<string> strings = strInput.Split(',');
//Generate the XML
XElement planyears = new XElement("planyears");
foreach (string str in strings)
{
planyears.Add(new XElement("planyear", str));
}
}
|
|
|
|
|
Please help me i want a code which allows the user to add, edit and delete records on the datagrid in visual basic without the help of a wizard but code please help me
|
|
|
|
|
|
|
Hi,
i have a problem for making rfid program with socket in c#.
i try this code :
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
IPAddress[] ip = Dns.GetHostAddresses(ipLoc);
IPEndPoint ep = new IPEndPoint(ip[0],23);
socket.Connect(ep);
Console.WriteLine("Connected");
char open1 = (char)13;
char open2 = (char)10;
//char[] myArray = new char[] { open1, open2 };
Byte[] sendBytes2 = Encoding.ASCII.GetBytes(Convert.ToString(open1));
Byte[] sendBytes = Encoding.ASCII.GetBytes(Convert.ToString(open2));
//Byte[] sendBytes2 = Encoding.ASCII.GetBytes("10");
//socket.Send(sendBytes);
socket.Send(sendBytes2);
socket.Send(sendBytes);
count = socket.Receive(buffer);
Console.WriteLine(System.Text.Encoding.ASCII.GetString(buffer, 0, count));
//socket.Shutdown(SocketShutdown.Both);
socket.Disconnect(true);
socket.Close();
but i not have a result.. rfid card not read in console and gate cannot to open..
i hope all of you can help my problem..
thanks very much..
|
|
|
|
|
Nowhere near enough information.
I presume the socket code is trying to talk to the RFID receiver? Not the gate? It appears you are sending it a CRLF - what's the purpose of doing this?
Regards,
Rob Philpott.
|
|
|
|
|
It is probably necessary for you to have the specification for the RFID reader.
Usually there is code samples available if you go to the vendors site.
|
|
|
|
|
I have done with .Net (C# and ASP).I want to know the future scope for the .Net technology in next 15-20 years.
Thank You.
|
|
|
|
|
Me too...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
You're never going to get an answer to this question as no one on this earth has a crystal ball that really works.
|
|
|
|
|
First, What do you mean by "I have done", does it mean you having nothing else to learn in .Net?
Now, to your question,
Go back 10 years (may be to the year 2001)and recall how the .Net and C# was doing. Visualize the changes since that.
however, in next 15 years or so, the changes is going to be further sharp. No one can predict this.
Best ways are to,
1. Not only learn a language or technology, Learn the technique "How to learn and adopt"
2. Learn to travel with the time
|
|
|
|
|
We are now in the planning stage of the next web based project using C#, MVC 5 and Entity framework 6. We are discussing about framing the project using the Repository pattern. We already have the full database ready. So, it is going to be Database first.
Now, my question : Is it feasible / worth using Repository pattern with database first approach? I got this doubt because, many sources and examples found in internet are Code first approach. If it is possible can you please provide me any advice or online/article sources to refer. Thanks.
I welcome any ideas or suggestions on Repository pattern.
|
|
|
|
|
Of course you can. Mind you, I would suggest that you don't just concentrate on this one pattern. I find that it goes hand in hand with the Unit Of Work pattern to help simplify things.
|
|
|
|
|
As Pete O'Hanlon said, you can. We use the Repository pattern + Unit of Work on the project I'm on right now. While we do use Code First, there is no reason it can't apply to Database First as well. Someone can correct me if I'm wrong, but I don't think the purpose of the Repository pattern was designed specifically for Code First. One advantage of using Repo is testing, another is dependency injection. It's simple to test using a Repository, from what I can tell here.
Read some more info here: http://stackoverflow.com/questions/8749153/why-use-repository-pattern-or-please-explain-it-to-me[^]
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
How do I compare two tables and get the difference?
Dim dtBenefitsCurrent As New DataTable
dtBenefitsCurrent = objDB.GetPlanBenefits(groupID, planID, SequenceNumber)
Dim dtBenefitsPreviousYear As New DataTable
dtBenefitsPreviousYear = objDB.GetPlanBenefits(PreviousgroupID, PreviousplanID, PreviousSequenceNumber)
Dim dyDifference ????
|
|
|
|
|
Do you want to compare their structure, or their data?
The most obvious way is looping through the data, and looking whether the second table has the same. Exit as soon as they are not, or loop until the end and return a list of differences.
AFAIK, there's no built-in functionality to compare datatables and get a diff.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
am trying to get a message box to show a message when label reaches an set number like 5 on timer had a message pop up but it kept firing uncontrollably
this is what I want
'If Label3.Text = 1 Then
Message Box.Show("done")
End If
would like a sound to accompany message
can anyone point me in the right direction
Thank you
|
|
|
|
|
|
|
Please help me...
objCreateMasterBenefit.CreateMasterBenefitDocument return SpreadsheetDocument how can I output so users can choose to save/open doc in web apps...
Dim MemoryStream As New MemoryStream
Try
Response.ClearHeaders()
Response.ClearContent()
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" '"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" '"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" '"application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment; filename=" & lblEditedPlan.Text)
Response.Charset = ""
Me.EnableViewState = False
objCreateMasterBenefit.CreateMasterBenefitDocument("Master_Benefit_"".xlsx", MemoryStream, groupID, planID, SequenceNumber)
MemoryStream.WriteTo(Response.OutputStream)
Response.Flush()
Catch ex As Exception
Throw
Finally
MemoryStream.Close()
MemoryStream.Dispose()
End Try
Response.End()
Response.End()
|
|
|
|
|
Are you asking how to put something in a MemoryStream? Or why your code doesn't work?
If the latter then you are going to need to explain more what it does do (versus what you want it to do.)
Also, but just guessing, your content type values seem much more complex than I would expect.
|
|
|
|
|
Try
MemoryStream.Position = 0
MemoryStream.WriteTo(Response.OutputStream)
Next to that, you'd want to rename that to have some other name than the class! Call it "MyCoolMemoryStream", but don't copy the name of the class and use it as a variable - makes stuff hard to read.
Also, you'd like to give that method that creates the file an enum, denoting "Excel XML" - the method itself should find the proper file-extension that should be used therefore.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I just notices most of the blogs I used to follow are no more updated by they creator.
What are the good .NET / C# / Application Lifecycle blogs with RSS feed of this moment. I prefer to follow people than organizations. I like blogger that write one article, news or tutorial by weak or month.
Thank you,
|
|
|
|