|
If you are using asp.net code behind c# means put the code in postback event.
kesavan
|
|
|
|
|
I'd say your best bet would be to create a registry entry, firstRun, 0-1.
Then check that registry value to check if it is your apps first run, if it is execute block of code, set value to 0 for false, next time you start up the program it will check the value and see firstRun is false and the skip the block of code.
Hope that helps.
He who laughs last is a bit on the slow side
|
|
|
|
|
hi Nero ,
Thamks 4 u r reply , But Iam not awareof registry entry concept,Could u pls tell me detailed how do i do it.
|
|
|
|
|
|
pls try nt 2 use smsspk in da 4rm. s'not a mob fone.
|
|
|
|
|
there is a image on a click on one part of an image i have to connect a page
and another part i have to do connect someother page
how to do this piece of work
thanking u
|
|
|
|
|
Split the image in two parts and put two image controls on the page and write your code accordingly.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
I was wondering if it is possible to compare file attributes over the internet?
|
|
|
|
|
Hi Frnds,
i have a issue in C#.
when i run some code which i downloaded from internet i got the error like.
"visual studio can not start debugging because the debug target 'so so so so path .exe' is missing. please build the project and retry, or set the output path and assemblyname properties appropriately to point at the correct location for the target assembly."
i dont know how to resolve..i search on internet since 1 week still i m not able to get the solution...
i post in forum also asked some developers but still i am not getting the solutions.
i m not able to run project...because in Bin directory there is no (.EXE) it is not necessary that we must have (*.exe) in BIN directory.
in my some program if i delete the Bin Folder and again run then it will automatically created BIN folder and (.exe) file also in those project i didnt get error that you have no (.exe)
in some program if i click on the Rebuil System. then it delete (.exe) and the program will not run and get the same error like "visual studio can nt start debugging ......................"
i know this problem is small for all of you... please try to solve and give me the proper suggestion
Awaiting for your positive reply..
patelhiren20@rediffmail.com
Thanks & Regards
Hiren Patel
patelhiren20@rediffmail.com
hiren
|
|
|
|
|
If there's no exe, then your build has failed. That's what happens when you grab code at random and add it to your project.
What is the error with the actual code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Tools->Options->Projects and Solutions->Build and run:
set: "On Run, when projects are out of date:" to: "Always build"
set: "On Run, when build or deployment errors occur:" to "do not launch"
life is study!!!
|
|
|
|
|
Hi,
I am having a WCF service which exposes two functions. One returns a string and another returns an array of custom object Employee. Employee class is a DataContract and all it contains is simple premitive data types marked as DataMember. First method works fine but I am not able to get the second method GetEmployeeArray() working.
Any clues how to pass complex data types with premitive data members in WCF?
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Just curious but what type of formatter are you using. I have had success using the BinaryFormatter but it has a bit different syntax from the Messaging namespace for MSMQ. I was passing a generic list and it was working pretty good. Can you post a code bit of code so I can see what it looks like?
|
|
|
|
|
Thanks for the quick reply Kevin.
Here is my code.
My Service Contract looks like this.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.ServiceModel;<br />
using System.Data;<br />
<br />
namespace WCFService<br />
{<br />
[ServiceContract] <br />
public interface IWCFService<br />
{<br />
[OperationContract]<br />
string GetSystemIPAddress();<br />
<br />
[OperationContract]<br />
object[] GetEmpolyeeArray();<br />
}<br />
}<br />
The class implementing the service contract looks like this.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using SystemInfo;<br />
using System.Data;<br />
using System.ServiceModel;<br />
<br />
namespace WCFService<br />
{<br />
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]<br />
public class WCFService : IWCFService<br />
{<br />
#region IWCFService Members<br />
<br />
public string GetSystemIPAddress()<br />
{<br />
return new SystemInfo.SystemInfo().GetIPAddress();<br />
}<br />
<br />
public object[] GetEmpolyeeArray()<br />
{<br />
DataSet ds = new SystemInfo.SystemInfo().GetEmployeeList();<br />
Employee[] emps = new Employee[ds.Tables[0].Rows.Count];<br />
int index = 0;<br />
foreach (DataRow row in ds.Tables[0].Rows)<br />
{<br />
emps[index] = new Employee();<br />
emps[index].EmployeeID = Convert.ToInt32(row["EmployeeNo"]);<br />
emps[index].Experience = Convert.ToDecimal(row["Experience"]);<br />
emps[index].FirstName = row["FirstName"].ToString();<br />
emps[index].LastName = row["LastName"].ToString();<br />
emps[index].MiddleName = row["MiddleName"].ToString();<br />
emps[index].Qualification = row["Qualification"].ToString();<br />
index++; <br />
}<br />
return emps;<br />
}<br />
#endregion<br />
}<br />
}<br />
My DataContract is this
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.ServiceModel;<br />
using System.Runtime.Serialization;<br />
<br />
namespace WCFService<br />
{<br />
[DataContract]<br />
public class Employee<br />
{<br />
[DataMember]<br />
public int EmployeeID;<br />
[DataMember]<br />
public string FirstName;<br />
[DataMember]<br />
public string MiddleName;<br />
[DataMember]<br />
public string LastName;<br />
[DataMember]<br />
public decimal Experience;<br />
[DataMember]<br />
public string Qualification;<br />
}<br />
}<br />
My Java client is like this:
<br />
package wcfjavaclient;<br />
<br />
<br />
public class Main {<br />
<br />
<br />
public Main() {<br />
}<br />
<br />
<br />
public static void main(String[] args) {<br />
try {
WS.WCFService service = new WS.WCFService();<br />
WS.IWCFService port = service.getBasicHttpBindingIWCFService();<br />
java.lang.String result = port.getSystemIPAddress();<br />
System.out.println("Result = "+result);<br />
} catch (Exception ex) {<br />
} <br />
} <br />
}<br />
Please let me know if you want to see anything more. First method GetSystemIP works fine. But second one does not.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Ok don't take this as fact I am working through the WCF myself. I had very similar issues so I experimented with the [XmlSerializerFormat] attribute for the service contract and got better results. I am not sure what the precise issue is but it seems to be related to the serilization of the array. I used a generic list instead of an array but I cannot see that that would make any difference.
|
|
|
|
|
Hi Kevin,
Thanks again and I am trying with [XmlSerializerFormat] attribute. But I do not know it is showing some wierd error like this.
Web service client can not be created by JAXWS:wsimport utility.
Reason: duplicate "message" entity: "IWCFService_GetSystemIPAddress_InputMessage"
My WSDL is like this.
<br />
<small><br />
<pre><br />
<?xml version="1.0" encoding="utf-8" ?> <br />
- <wsdl:definitions name="WCFServiceImplement" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="WCFServiceNamespace" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><br />
<wsdl:import namespace="WCFServiceNamespace" location="http://10.34.34.241:8578/WCFService?wsdl=wsdl0" /> <br />
- <wsdl:types><br />
- <xsd:schema targetNamespace="http://tempuri.org/Imports"><br />
<xsd:import schemaLocation="http://10.34.34.241:8578/WCFService?xsd=xsd0" namespace="http://tempuri.org/" /> <br />
<xsd:import schemaLocation="http://10.34.34.241:8578/WCFService?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> <br />
</xsd:schema><br />
</wsdl:types><br />
- <wsdl:message name="IWCFService_GetSystemIPAddress_InputMessage"><br />
<wsdl:part name="parameters" element="tns:GetSystemIPAddress" /> <br />
</wsdl:message><br />
- <wsdl:message name="IWCFService_GetSystemIPAddress_OutputMessage"><br />
<wsdl:part name="parameters" element="tns:GetSystemIPAddressResponse" /> <br />
</wsdl:message><br />
- <wsdl:portType name="IWCFService"><br />
- <wsdl:operation name="GetSystemIPAddress"><br />
<wsdl:input wsaw:Action="http://tempuri.org/IWCFService/GetSystemIPAddress" message="tns:IWCFService_GetSystemIPAddress_InputMessage" /> <br />
<wsdl:output wsaw:Action="http://tempuri.org/IWCFService/GetSystemIPAddressResponse" message="tns:IWCFService_GetSystemIPAddress_OutputMessage" /> <br />
</wsdl:operation><br />
</wsdl:portType><br />
- <wsdl:service name="WCFServiceImplement"><br />
- <wsdl:port name="NetTcpBinding_IWCFService" binding="i0:NetTcpBinding_IWCFService"><br />
<soap12:address location="net.tcp://10.34.34.241:8999/WCFService" /> <br />
- <wsa10:EndpointReference><br />
<wsa10:Address>net.tcp:
</wsa10:EndpointReference><br />
</wsdl:port><br />
- <wsdl:port name="BasicHttpBinding_IWCFService" binding="i0:BasicHttpBinding_IWCFService"><br />
<soap:address location="http://10.34.34.241:8888/WCFService" /> <br />
</wsdl:port><br />
</wsdl:service><br />
</wsdl:definitions><br />
</pre><br />
</small><br />
Any idea?
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hi Kevin,
Finally I have done with it. The problem is not with WCF and [XmlSerializerFormat] attribute is also not required for service contract. The key concept is JAVA client can not get an Array of object of DataContract member. I have tried several ways but Array of Employee class never worked out. I tried it with List<employee> and it worked very fine.
Thanks for your prompt response and guidance.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hi,
I am trying to open a file that not exit.
so want i want if file not there it should create a file with same name.
Thanks.
|
|
|
|
|
give a file name to openFileDialog
you can confirm if the file exist
if not you can create the same name file.
I want to make some friends here
|
|
|
|
|
Hi.
Thanks for your help.
I did same and it's working.
now what i want..
if folder not exit then how to check.
for example:
Path C:\XMLFiles\employee.xml
if file not exit we can check and create new file with same name but if folder not exit then what to do.
how to check and how to create new folder with same name.
help me.
Thanks
|
|
|
|
|
System.IO.File.Exists - something like that. If it doesn't exist, create it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
Thanks for reply but i want example on this.
Thanks
|
|
|
|
|
Well, which bit is confusing you ? I can't tell you how to create the file, I don't know why you're creating it, or what you want to put in it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I try to use UDPClient to send a file
but when i send a small file like 50k, the UDPClient works good
but when i send a file 500k
the UDPClient.Send() throw an exception
A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself
Someone can help me to fix this issue, it looks like the send buffer and receive buffer are to small.
I want to make some friends here
|
|
|
|
|
send file streams inspite the file directly
|
|
|
|