|
|
This is ONLY possible, if machine B is your server, or you have a way of communicating to machine B from the server. Machine B needs to be a webserver of some sort, or on the same network as your server, for this to be possible. You need to provide more information to get your solution, and it may be that you can't do it ( it usually is when people ask how to run an exe, but they usually want to run it on the client )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
do you have LAN connection from System A and System B...(both servers)
If so, pass UNC path to the System.Diagonistic.Process to run the exe with UserId and Password criteria.
But Mind that, the process with run in your machine by this process. If you want to run on System B, invoking the process from System A is not possible. You need to find some way say windows service or something that may invoke your process when some action is taken by System A.
|
|
|
|
|
Which of these machines is the server for this ASP.NET application ? If B, then it's trivial. If A, then it's not possible, with ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
System A contains ASP application that's the problem....
|
|
|
|
|
Hi All,
Can any body give me any code or Link how 2 use DataContractJsonSerializer.
Thanks
Vipin Paliwal
|
|
|
|
|
what about MSDN ??
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Product));
using (FileStream fs = File.OpenRead(@"c:\jsonText.txt"))
{
Product product = ser.ReadObject(fs) as Product;
MessageBox.Show("Product Name: " + product.Name);
}
[Serializable]
public class Product
{
public string Name;
}
Just see how Product is Deserialised from jsonText.txt file.
for further ref you can check this code as well
http://geekswithblogs.net/AzamSharp/archive/2007/11/04/116586.aspx
|
|
|
|
|
How to change the text in a Messagebox button ?
imgDelete.Attributes.Add("onclick", "return(confirm(Are you sure you want to delete the folder?'))");
in the confirmation messagebox the text can change in to Arabic, But two buttons 'Yes' and 'No' also I want to display in Arabic while changing culture.
|
|
|
|
|
You can't. Create your own popup window with your own buttons.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thats a good idea and you can go through these links will help you,
Link 1[^][^]
Link 2[^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
I´m building a functionality where the website will send emails with attached Excel-files. For some reason this does not work and I have tried to pinpoint the error. The code below runs perfect as long as the string does not exceed 2340 in length. I have been trying for two days to find out why I can not have longer strings than 2340. Any help would be much appreciated.
Using memoryStream As New MemoryStream()
Dim sData As String = "" ' getDataFromFile()
For i = 1 To 2342
sData += "A"
Next
Dim contentAsBytes As Byte() = Encoding.UTF8.GetBytes(sData)
memoryStream.Write(contentAsBytes, 0, contentAsBytes.Length)
' Set the position to the beginning of the stream.
memoryStream.Position = 0
' Create attachment
Dim contentType As New ContentType()
contentType.MediaType = MediaTypeNames.Application.Octet
contentType.Name = "attachment.xls"
Dim attachment As New Attachment(memoryStream, contentType)
' Add the attachment
message.Attachments.Add(attachment)
' Send Mail via SmtpClient
smtpClient.Send(message)
End Using
Error Message:
System.Net.Mail.SmtpException was unhandled by user code<br />
Message="Failure sending mail."<br />
Source="System"<br />
StackTrace:<br />
at System.Net.Mail.SmtpClient.Send(MailMessage message) at _SendMail.btnSendMail_Click(Object sender, EventArgs e) in E:\Visual Studio 2008\XlsMail\Default.aspx.vb:line 55 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br />
InnerException: System.IO.IOException<br />
Message="Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."<br />
Source="System"<br />
StackTrace:<br />
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response) at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn) at System.Net.Mail.SmtpConnection.OnClose(Object sender, EventArgs args) at System.Net.ClosableStream.Close() at System.Net.Mail.MailWriter.Close() at System.Net.Mail.SmtpClient.Send(MailMessage message)<br />
InnerException: System.Net.Sockets.SocketException<br />
ErrorCode=10060<br />
Message="A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"<br />
NativeErrorCode=10060<br />
Source="System"<br />
StackTrace:<br />
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)<br />
InnerException:
Glenn
|
|
|
|
|
hi ! all
i m devloping a serch file . and i want to break data set through while loop . i have break sentence that i have enter in my search box and show in label but how i break dataset . plz help me how i do for dataset .
i m sending code through i have break sentence and show in the label .
Dim filenameLen, i, j, index, indexarr, count As Integer
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If txtfiledesc.Text <> "" Then
filenameLen = txtfiledesc.Text.Length
indexarr = 0
j = 0
count = 0
For i = 0 To filenameLen - 1
count = count + 1
If Asc(txtfiledesc.Text.Chars(i)) = 32 Then
For index = indexarr To indexarr
fileNamePart(indexarr) = txtfiledesc.Text.Substring(j, count - 1)
Next
indexarr = indexarr + 1
j = i + 1
count = 0
End If
Next
fileNamePart(indexarr) = txtfiledesc.Text.Substring(j, count)
' Dim jim As Integer = fileNamePart.Length
Label1.Text = ""
Dim filterarr, filterarr1 As Integer
For filterarr = 0 To indexarr
If fileNamePart(filterarr).ToString.ToLower = "the" Or fileNamePart(filterarr).ToString.ToLower = "be" Or fileNamePart(filterarr).ToString.ToLower = "is" Or fileNamePart(filterarr).ToString.ToLower = "an" Or fileNamePart(filterarr).ToString.ToLower = "a" Or fileNamePart(filterarr).ToString.ToLower = "are" Or fileNamePart(filterarr).ToString.ToLower = "of" Or fileNamePart(filterarr).ToString.ToLower = "for" Or fileNamePart(filterarr).ToString.ToLower = "in" Or fileNamePart(filterarr).ToString.ToLower = "on" Or fileNamePart(filterarr).ToString.ToLower = "at" Or fileNamePart(filterarr).ToString.ToLower = "to" Or fileNamePart(filterarr).ToString.ToLower = "shall" Or fileNamePart(filterarr).ToString.ToLower = "will" Then
' fileNamePart(filterarr) = fileNamePart(filterarr + 1)
For filterarr1 = filterarr To indexarr - 1
fileNamePart(filterarr1) = fileNamePart(filterarr1 + 1)
Next
fileNamePart(filterarr1 + 1) = Nothing
' ReDim Preserve fileNamePart(fileNamePart.Length - 1)
filterarr = filterarr - 1
End If
Next
Dim ind1 As Integer
For ind1 = 0 To 10
If (fileNamePart(ind1) <> fileNamePart(ind1 + 1)) And (fileNamePart(ind1) <> Nothing) Then
filterfilename.Add(fileNamePart(ind1))
End If
Next
'fileNamePart = DirectCast(Resize(fileNamePart, 5), String())
Dim z As Integer = 0
While z < filterfilename.Count
Label1.Text = Label1.Text & " || " & filterfilename.Item(z) ' fileNamePart(0)
z = z + 1
End While
|
|
|
|
|
This is a disaster
prabhat kumar mokama wrote: If fileNamePart(filterarr).ToString.ToLower = "the" Or fileNamePart(filterarr).ToString.ToLower = "be" Or fileNamePart(filterarr).ToString.ToLower = "is" Or fileNamePart(filterarr).ToString.ToLower = "an" Or fileNamePart(filterarr).ToString.ToLower = "a" Or fileNamePart(filterarr).ToString.ToLower = "are" Or fileNamePart(filterarr).ToString.ToLower = "of" Or fileNamePart(filterarr).ToString.ToLower = "for" Or fileNamePart(filterarr).ToString.ToLower = "in" Or fileNamePart(filterarr).ToString.ToLower = "on" Or fileNamePart(filterarr).ToString.ToLower = "at" Or fileNamePart(filterarr).ToString.ToLower = "to" Or fileNamePart(filterarr).ToString.ToLower = "shall" Or fileNamePart(filterarr).ToString.ToLower = "will" Then
Consider writing code that's not case sensitive, and storing these words somewhere so it's easy to add/remove them
I can't work out the rest, or what you're asking. Perhaps if you point out where in the code you need help ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
First of all don't give others code to net.
Second what are you doing in the above code do not matches with your Query.
Third First clear your logic then learn .net and then post a query.
|
|
|
|
|
|
Add column this way
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + filepath + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1;'";
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
DbDataAdapter adapter = factory.CreateDataAdapter();
DbCommand selectCommand = factory.CreateCommand();
selectCommand.CommandText = "SELECT Fname FROM [Sheet1$]";
DbConnection connection = factory.CreateConnection();
connection.ConnectionString = connectionString;
selectCommand.Connection = connection;
adapter.SelectCommand = selectCommand;
DataTable dt = new DataTable();
adapter.Fill(dt);
DataColumn dc = new DataColumn();
dc.ColumnName = "Lname";
dt.Columns.Add(dc);
foreach (DataRow dr in dt.Rows)
{
dr["Lname"] = "LastName";
}
himanshu
|
|
|
|
|
Himanshu,
I see this creates a data table, which isnt what i really wanted to do.
Thanks for the suggestion, but how do i then extend this code to perform the SQLBulkCopy over to the server????
Thanks.
|
|
|
|
|
Hi,
i dont think there is any way to add columns to datareader.
try this
string connectionString1 = @"Data Source='local\SQLEXPRESS';Integrated Security=True;Pooling=False;Initial Catalog='MASTER'";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + filepath + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1;'";
OleDbConnection con=new OleDbConnection(connectionString);
using (OleDbCommand dcmd = new OleDbCommand("SELECT Fname FROM [Sheet1$]",con))
{
try
{
con.Open();
using (OleDbDataReader dreader = dcmd.ExecuteReader())
{
DataRow myNewRow;
DataRow[] drcol ;
DataTable dt = new DataTable();
dt.Columns.Add("Fname");
dt.Columns.Add("Lname");
myNewRow=dt.NewRow();
while (dreader.Read())
{
myNewRow[0] = dreader.GetValue(0).ToString();
myNewRow[1] = "Test123";
dt.Rows.Add(myNewRow);
}
drcol = dt.Select();
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString1))
{
bulkCopy.ColumnMappings.Add("Fname", "FirstName");
bulkCopy.ColumnMappings.Add("Lname", "LastName");
bulkCopy.DestinationTableName = "T_EmpDetail";
bulkCopy.BatchSize = 500;
bulkCopy.WriteToServer(drcol);
}
}
}
finally
{
con.Close();
}
}
himanshu
|
|
|
|
|
I managed to come up with a very similar solution to this but a little simpler since i only need to add a column and populate it, rather than adding new rows.
Ill post the details later.
Thanks again for all the help everyone!
|
|
|
|
|
<asp:LinkButton ID="lnkUpdate" runat="server" OnClientClick='<%#Eval("Sys_TV_Id","return update({0})") %>' OnClick="lnkUpdate_Click">修改</asp:LinkButton>
this linkbutton in repeater.
I do not konw " Eval("Sys_TV_Id","return update({0})") ".
<script type="text/javascript">
function update(ID){
var data=new Array();
if(ID==null ||ID==""){
temps=eval('document.form1.id');
var j=0;
for(var i=0;i<temps.length;i++)
{
if(temps[i].checked==true){
data[j]=temps[i].value;
j++;
}
}
}
else{
data[0]=ID;
}
if(data==""){
alert('请选择操作对象!');return false;
}
else{
$("updateId").value=data;return true;
}
}
</script>
|
|
|
|
|
know means this what dont I. Sorry!!
|
|
|
|
|
Questions is not clear. Could you please elaborate
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
the force strong in you is
|
|
|
|
|
For future reference, if you google the Eval method, the MSDN docs give you the overloads.
This evaluates Sys_TV_Id, and puts it in place of {0} in the string provided. In other words, it calls string.Format.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
I need to display diffrent images in a cell of a gridview according to the value to be filled there.
Eg:
My gridview display:
100 200 400 100 600
200 200 100 400 100
I want to display diffrent images for each number, If 100, image1. for 200, image2...etc.
thks
|
|
|
|