|
You don't have to be sorry!
|
|
|
|
|
Somebody could use SQL Server Management Studio.
|
|
|
|
|
I am quite new to C# and I am having a mental blank day . I've extracted some data from a database, several of the columns of data are stored in a shortened form. When displaying the data to the user I would like to convert the shortened form to full text. For example 'D' would become 'Decommissioned'.
Currently the data is extracted and displayed from the code below
MySqlDataAdapter da = new MySqlDataAdapter(cmdSQL);
DataSet ds = new DataSet();
da.Fill(ds, "template");
gridGuide.DataSource = ds.Tables["template"];
What is the best way to head now?
Thank you for you help.
|
|
|
|
|
Karlos_V wrote: For example 'D' would become 'Decommissioned'.
Fix your SQL query.
|
|
|
|
|
I would do it within the SQL query but it is a large database and there could be 50 to 60 different conversions for each column within some tables therefore I was thinking it would be better for the server and network that the processing of this was done on the client computers.
|
|
|
|
|
Karlos_V wrote: 50 to 60 different conversions
There is no conversion, simply do:
Select D as 'District' ...
|
|
|
|
|
Sorry if I am being confusing, let me word it in a different way. Ignore that the data has come from a database as I am only interested in it once it is in a dataset within the program.
I have a dataset with a datatable, I would like to change the data held within a column of a table so that any occurences of 'C' now become 'Commissioned', 'L' becomes 'Live' etc.
Is there a quick method of doing this or do I need to go through cell by cell passing it to a function?
|
|
|
|
|
Without knowing more information what you want to do with the "converted" values and other restriction, it's hard to suggest any solution.
For instance,
1. You can have mapping tables and join them in your query.
2. You can have specialized custom control that do the "conversion".
3. If you are displaying them in a combobox, you can make use of the DisplayMember and ValueMember when you bind the property to it.
4. And of cos you can go and change the value yourself in the dataset, which probably is the least efficient way.
|
|
|
|
|
Hi,
I have tried and im successful in transferring a large file say 200mb to from server to client. but the problem is i get 100% CPU usage while the file is transferring.
if i have a file of 200MB, it will have 209715200 bytes; now to send this file, i first made partitions of 4000Bytes. If we take Mode of its total size with 4000, we'll get 3200Bytes remaining, and the rest of it remains 209712000 which is exactly divisible by 4000. What my program do is first it sends the 3200Byte chunk and then the remaining 209712000Bytes. If we divide 209712000 by 4000, we'll get 52428. Which means the loop will run 52428 times in order to send the whole file. And same goes on the server side when it is receiving the file. These loops make my CPU hit 100%. And if i push the whole buffer to the network it says the buffer is full and EXCEPTION. Please tell me a good solution to transfer file without using that much CPU. I'm making a file sharing server, if CPU will hit 100% on one client, i wont be able to support more than two client or even 1.
|
|
|
|
|
|
|
Hi,
I have a directory which contains multiple sub directories.
Inside those sub-directories are zip files protected by a password.
The password for all the zip files (156) are the same.
Is it possible with C# DotNet and the ICSharpZipLib to remove the passwords?
So not unzip it, only remove the passwords....
Any help would be greatly appriciated!
|
|
|
|
|
I see you asked this question in the SharpZipLib forums, that's probably your best bet.
As far as I'm aware, there isn't a way to do this. I think you need to create a new zip without the password.
Life, family, faith: Give me a visit.
From my latest post: "When Constantine severed the Hebrew origins of this faith in Messiah, a new religion was officially created. It is this religion that Orthodox Jews fear their relatives and friends becoming members of."
Judah Himango
|
|
|
|
|
Hello everyone,
I am using Windows Server 2003. When call the Start method of HttpListener, there is the following exception -- System.Net.HttpListenerException: Access is denied.
Any ideas how to grant the access?
thanks in advance,
George
|
|
|
|
|
You sure the port isnt in use already?
Are you running the HttpListener under sufficient privileges?
Are you trying to run this in an ASP.NET app?
|
|
|
|
|
Thanks leppie,
1.
I am sure the port is not in use by using netstat tool.
2.
I am running a Windows service application written in C#. I am using account "NT AUTHORITY\NetworkService".
3.
I am not writing ASP.Net, I am writing a Windows service application.
Any ideas?
regards,
George
|
|
|
|
|
George_George wrote: I am running a Windows service application written in C#. I am using account "NT AUTHORITY\NetworkService".
Try running it under an Administrator account if possible. I cant recall if NetworkService user has both listen and connect rights.
|
|
|
|
|
Thanks leppie,
I found when using administrator account to run the service, everything is fine. So I think it may be the issue of using NT AUTHORITY\Network Service account, which is not granted enough privilege.
Now I am going to try to reproduce this issue, my current question is, when assign the log-on account back to NT AUTHORITY\Network Service, and clicks ok in SCM, there is an error message which indicates me to input a correct password for NT AUTHORITY\Network Service.
But I do not know the password for this account. And I want to reset the password for NT AUTHORITY\Network Service.
How to reset the password for this account? Normally to any other account in the Windows server 2003? I have this question is because I noticed a couple of the Windows Services on my local computer is using this account to log on, I do not want to impact other services when changing the password for account NT AUTHORITY\Network Service.
Any comments?
regards,
George
|
|
|
|
|
Both the NT AUTHORITY\LocalService and NT AUTHORITY\NetworkService accounts are built-in accounts in Windows.
You can not use these accounts to log in to Windows and they not show up in the user management MMC snap-in.
These accounts have no password either, so when reseting the service to use the NT AUTHORITY\NetworkService just enter empty password.
|
|
|
|
|
Thanks Zoltan!
I have successfully set the account, cool! I have a further question, is NT AUTHORITY a domain setup on local computer, I have this question because I noticed that there is a sign \ after it like normal domain name.
regards,
George
|
|
|
|
|
It's the identifier authority (I didn't know that )
Take a look at this link[^] for a detailed explanation.
|
|
|
|
|
Really great! Thanks Zoltan!
regards,
George
|
|
|
|
|
Did you try Local System Account?
|
|
|
|
|
|
I suggested Local System account because it has full access to the computer.
Looks like the NT AUTHORITY\NetworkService has anonymous access to network resources and that is why it fails to create sockets.
|
|
|
|