|
hi
i write this code to define a method :
CodeMemberMethod method_getData = new CodeMemberMethod();<br />
method_getData.Attributes = MemberAttributes.Public;<br />
method_getData.Name = "GetData";<br />
method_getData.ReturnType = new CodeTypeReference(typeof(DataTable));<br />
ctd.Members.Add(method_getData);<br />
<br />
CodeParameterDeclarationExpression method_getData_p1 = new CodeParameterDeclarationExpression(typeof(System.Data.SqlClient.SqlCommand), "cmd");<br />
method_getData.Parameters.Add(method_getData_p1);
in body of my method, i want to daclare some variables and create new instatnce of it's class and assign value to it, like this :
SqlConnection con = new SqlConnection(this.ConnectionString);
but, how to do this ?
thanks
|
|
|
|
|
|
Dear friends,
I'm doing the console application to listen the call information from our telephone exchange and calculate the bills. Below is the function to listen the calls and save. I'll explain the process.
1) Getting string Data from the exchange through TCP/IP.
2) Split the string and calculate call cost according to the data available in database.
3) save the calculated values in a database
4) write the calculated data in console window.
The above process is happening in round trip. Some times the SaveData(clientDataInString); function is taking more time(more than 10 sec) to complete. Mean time the exchange is sending the data for more than one call. so while receiving the data from the exchange next time i'm getting the concordinated string with more than one calls information. I cannot reduce the time of SaveData function. So i want to do the SaveData process in asynchronous manner or multi thread. Can any one help me please.
#region "Listern"
private static void Listern()
{
try
{
if (strServer == string.Empty)
{
Console.Write(" Enter server name/address: ");
strServer = Console.ReadLine();
Console.Write(" Enter remote port: ");
strPort = Console.ReadLine();
}
Console.Clear();
//IPEndPoint ipEnd = new IPEndPoint(IPAddress.Parse("10.148.146.43"), 5656);
IPEndPoint ipEnd = new IPEndPoint(IPAddress.Parse(strServer), Int32.Parse(strPort));
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
sock.Bind(ipEnd);
sock.Listen(100);
Socket clientSock = sock.Accept();
byte[] clientData = new byte[1024];
NetworkStream ns = new NetworkStream(clientSock);
while (bActive)
{
int receivedBytesLen = ns.Read(clientData, 0, clientData.Length);
string clientDataInString = Encoding.ASCII.GetString(clientData, 0, receivedBytesLen);
ns.Flush();
// the loop should not wait if the function is getting delay. It has to just call this function and go to listen next call info immediately. for the next call info the function should start another thread.
//Save in sql server
SaveData(clientDataInString);
}
ns.Close();
clientSock.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Application.Run();
}
}
#endregion
|
|
|
|
|
|
inside my datagrid i added a Boolean column, the problem is that when i click the checkbox inside the datagrid it doesn't display checked but only when i leave to another check box
please somebody help
here is the code :
DataGridBoolColumn boolColumn = new DataGridBoolColumn();
boolColumn.MappingName="Mapped";
boolColumn.AllowNull=false;
boolColumn.Width=50;
boolColumn.AllowNull = false;
boolColumn.ReadOnly=false;
boolColumn.HeaderText="Mapped";
GridTableStyle.GridColumnStyles.Add(boolColumn);
|
|
|
|
|
michael_jhons wrote: when i click the checkbox inside the datagrid it doesn't display checked
Where is it not displaying? In the debugger, another column in the datagrid? I feel this information is vital to produce a correct response to your question.
Just because we can; does not mean we should.
|
|
|
|
|
Dear KaptinKrunch
it is not displaying that is checked in the column itself "the checkBox COLUMN".in normal situation, once u click a checkbox it appear that is checked, but in my case when i click it and when i leave to another cell in the datagrid it appear that is checked, not directly when i checked it before.
hope i clearify my point
thanks for your help
|
|
|
|
|
If Anybody can Help
I have created the sample web service using c# in .net . In Run time dynamically generate the SOAP,WSDL code .
SOAP 1.1
*********
POST /Webservices/MyService/MyWebservices/Calculate.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Add"
<soap:envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:body>
<add xmlns="http://tempuri.org/">
int
int
WSDL
****
http://localhost/Webservices/MyService/MyWebservices/Calculate.asmx?wsdl
<wsdl:definitions targetnamespace="http://tempuri.org/">
<wsdl:types>
<s:schema elementformdefault="qualified" targetnamespace="http://tempuri.org/">
<s:element name="Add">
<s:complextype>
<s:sequence>
<s:element minoccurs="1" maxoccurs="1" name="a" type="s:int">
<s:element minoccurs="1" maxoccurs="1" name="b" type="s:int">
.........
........
........
1)How to generate the this code
2)What is the internal function of SOAP,WSDL,UDDI
|
|
|
|
|
I've created a remoting application that uses an assembly located in the GAC. When I try to run a client application that grabs the remote object and uses an object in the GAC assembly I get an exception. Everything works fine if the assembly is not signed. Thanks for any help.
<small>System.Runtime.Serialization.SerializationException was unhandled<br />
Message="Because of security restrictions, the type PLCLib.PLCMediator+PLCConnection cannot be accessed."<br />
Source="mscorlib"<br />
StackTrace:<br />
Server stack trace: <br />
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)<br />
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)<br />
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)<br />
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)<br />
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)<br />
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)<br />
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)<br />
Exception rethrown at [0]: <br />
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br />
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)<br />
at PLCLib.PLCMediator.WriteBit(PLCConnection connection, String dataAddress, Boolean dataIn)<br />
at PLCDriverConsole.WriteBit.WriteBits(PLCConnection connection, String dataAddress, Boolean dataIn) in C:\Brad\PLCDriverConsole\PLCDriverConsole\Program.cs:line 57<br />
at PLCDriverConsole.Program.Main(String[] args) in C:\Brad\PLCDriverConsole\PLCDriverConsole\Program.cs:line 20<br />
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)<br />
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()<br />
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)<br />
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)<br />
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()<br />
InnerException: System.Security.SecurityException<br />
Message="Request failed."<br />
Source="mscorlib"<br />
GrantedSet=""<br />
PermissionState="<PermissionSet class=\"System.Security.PermissionSet\"\r\nversion=\"1\"\r\nUnrestricted=\"true\"/>\r\n"<br />
RefusedSet=""<br />
Url=""<br />
StackTrace:<br />
at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)<br />
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)<br />
InnerException: </small>
|
|
|
|
|
Dio22 wrote: "Because of security restrictions, the type PLCLib.PLCMediator+PLCConnection cannot be accessed."
Your problem is noted right there for you.
Just because we can; does not mean we should.
|
|
|
|
|
Thank you Kaptin obvious. What's causing the security exception? I need help fixing the problem, not identifying it.
|
|
|
|
|
I need devlopped one function that permit a conference in VoIP(Voice over IP.
It's possible to integrate this function in my program?
|
|
|
|
|
All knowing GOOGLE[^] has the answers you seek.
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
asma_pfe wrote: It's possible to integrate this function in my program?
yes.
|
|
|
|
|
how? and if you have an idea can you help me please
thank you
|
|
|
|
|
What part of the C# is giving you trouble?
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Well... Here is a start for you
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace conferenceVOIP
{
class Program
{
static void Main(string[] args)
{
throw new Exception("The program code needs to be implemented.");
}
}
}
Now where do you have problems form there?
|
|
|
|
|
Thank you for your help
I need the instructions of this function, can you completed this for me please
|
|
|
|
|
Hey Guys,
I have some doubts about the code written by Shelly Jain in <a href="http://www.codeproject.com/KB/cs/mswordcount.aspx">http://www.codeproject.com/KB/cs/mswordcount.aspx</a>[<a href="http://www.codeproject.com/KB/cs/mswordcount.aspx" target="_blank" title="New Window">^</a>].
First of all I don't know anything about C#, what I know is ASP and I am learning ASP.Net, but any help would be great.
My first doubts it is if this script (or other that you know that does the same thing) works with other Microsoft Offices Applications, such as Excel and PowerPoint?
I also would like to know if it can be implemented with ASP.Net and if it works in real time, for example. If I upload a MSWORD file with ASP.Net, the result of number of pages would show right away or it would take a while for the server open the file and count it?
And would the script be able to count 10 (or more) files for different users at the same time, like uploading files of multiple users at the same time, or it would need some time between each page counting?
Thank you and I appreciatte if you can help me.
|
|
|
|
|
Ferrarih wrote: My first doubts it is if this script (or other that you know that does the same thing) works with other Microsoft Offices Applications, such as Excel and PowerPoint?
No, just word (see line Word.ApplicationClass WordApp = new Word.ApplicationClass(); ).
Ferrarih wrote: If I upload a MSWORD file with ASP.Net, the result of number of pages would show right away or it would take a while for the server open the file and count it?
It would obviously need some time to open it. The question of how fast is down to file size, disk usage, disk speed; loads of factors.
Ferrarih wrote: And would the script be able to count 10 (or more) files for different users at the same time
Yes, you could do 100000000000000000000000000000000000000000000000000 users at the same time, it's more of a question of does the server have sufficient resources (and for 1000000000000000000... it probably wouldn't).
|
|
|
|
|
Hey Guys
I konw this isnt a C# question but i dont know where else to post this question
i use SubVersion(Server) & TortoiseSVN(Client) at work for my ever growing application, now the server my repository is on needs to be formatted next week, dont know why...
does anybody know how to RE-REGISTER my repository on that server once it has been formatted? im new-ish to subversion myself and im the only one at work with half a clue how it works...
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
hi everyone
How do I get hardware id from client with c# or vb.net, I'd like to get cpu_id and ComputerSystemProduct.
source code I will run on MS windows server 2003 for get hardware id from client
thanks for advance
indy
|
|
|
|
|
Normally "serial hardware" is physical and can only be emulated in C# or VB.NET...
CPU Serial Numbers on the other hand are accessible via windows scripts:
http://www.microsoft.com/technet/scriptcenter/scripts/hardware/basic/hwbavb03.mspx?mfr=true[^]
At times the other info you're looking for is in the reg:
HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName
HKLM\SOFTWARE\Microsoft\PCHealth\HelpSvc\OEMInfo
If it is an OEM machine sometimes you can find that info in this .ini file also:
%systemroot%\system32\OEMINFO.INI under [General] there is a Manufacturer=
|
|
|
|
|
Hi
Please check in below link, for sample
www.eggheadecafe.com
Thank you
|
|
|
|
|
www.eggheadecafe.com[^]
I can't open this website may be server was problem
do you have any opinion for advise
thank you
indy
|
|
|
|