|
Put brackets around the alias;
"select emp_no as [emp no] from ..."
|
|
|
|
|
Dear all,
We are working on an eCommerce application nearly ready to go online.
The issue we face is that when we upload an image to the product, it does not fit in the prorate form, It gets stretched either vertically or horizontally thereby getting it out of shape.
The image thumbnail layout type that we have in the front end is in Landscape, and if the image being uploaded is in a landscape format, it fits perfectly, also with size reduction. But if the image being uploaded is in Portrait format, it gets stretched to the full width making it look 'out of shape'.
Will appreciate if some one can suggest a code or an external API which can display the image in proportionate without stretching.
|
|
|
|
|
You just need to modify your code so that images are displayed at the actual size of the image, rather than the size of the display window or panel.
|
|
|
|
|
You can either display the image as it is, or if you really want to make it a set size you'll need to change the image when you upload it so it fits the space. Google for "c# change aspect ratio of image" and you should find some sample code, it's just a bit of maths and using GDI.
|
|
|
|
|
Hi! May someone tell me how i can scan a qrcode and show the data in a textbox in the same time save the data in database?
Thx in advance.
|
|
|
|
|
Where is the scanner, and what is it connected to?
|
|
|
|
|
You'll struggle to do this because asp.net can't access the client hardware. If you did some basic research and googled you'd find questions from the countless other people that want to scan QR codes and use fingerprint readers that have all been told much the same thing.
|
|
|
|
|
Hello All,
I have question about testing my web application in window phone. i was made one application in Asp.net(c#) in this application i use Canvas Control for users digital signature. my application working fine in Android and i-phone application . Now i want to test this application on window phone . so there is any way to test application in window phone from my Visual Studio 2012 or any Emulator for that.
Thanks
Sanket
|
|
|
|
|
How to write case statment with sql query in code behind file that is file.cs ....please help me out.
Thanks
|
|
|
|
|
The same way you'd write any other SQL query in the code-behind.
using (SqlConnection connection = new SqlConnection("YOUR CONNECTION STRING"))
using (SqlCommand command = new SqlCommand("SELECT CASE WHEN @Flag = 1 THEN 'Yes' ELSE 'No' END FROM YourTable", connection))
{
command.Parameters.AddWithValue("@Flag", true);
...
}
If you want a more detailed answer, then you're going to have to provide a more detailed question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how to add jqgird when i selected a dropdown li
xga
modified 2-Dec-15 4:10am.
|
|
|
|
|
Did your keyboard suddenly stop working?
|
|
|
|
|
I'm writing a windows form app to send emails for a mailing list, that the user can use on there local machine.
So I'm searching around and found this, but it seems outdated.
https://support.microsoft.com/EN-US/kb/308056[^]
I'm familiar with writing web services for web forms that JQuery can access, but not familiar with it using a Windows App. Like using Json, or just a class to send and receive data.
What are you guys using?
|
|
|
|
|
It's not clear what you need... why are you having to access a web server/service at all? You can send emails directly from a Windows application...
|
|
|
|
|
To get the current subscriber list.
The web application for the program proved to be too difficult for average people to use. I used CKEditor for folks to create the messages, and wrote a service to send them from the website.
But I changed the service over to Entity Framework, and I'm having trouble with it. So for black Friday, I wrote a windows app to send the Black Friday Emails, and it was just easier to do. So I thought I'd write a windows app to do the whole thing.
It's been so long since I wrote the service, I forgot how to debug it.
|
|
|
|
|
Is it possible to make a direct connection to the database that the website is referencing?
That would make things simple.
|
|
|
|
|
I can make a direct connection, but the customers that will use the program won't be able to access the data through the firewall. I don't want to alter the firewall programming.
I'll figure it out.
|
|
|
|
|
I wrote a web service, and tied it to an asmx page.
Then I wrote a Serializable Class, with get and set, for the request and response.
In the web service, the input is the request class, and it outputs the response class. Used SQL Linq for the database calls.
Then in the Windows App, I created a service reference, using the WSDL that is generated when you add ?wsdl to the url. And in calling the service, I just changed the endpoint, and used basic http binding to test it.
So the class I need for the request and response are contained in the Service Reference.
And I just used those classes as a ListOf, to populate a listview control.
So I guess the whole thing happens with SOAP.
I'm impressed, had no idea it would be that easy to do. I've always consumed web services, but never wrote one. The ones I wrote were for JQuery, and returned JSON back to be parsed.
That is slick!
|
|
|
|
|
If it works, it's solved!
Most things are easy - once you know how to do them!
There's a well-known story about a mathematician giving a lecture - he's scribbling away on the blackboard, one equation after another, saying "and so it follows... (scribble scribble) therefore ... (scribble scribble)..." and then he gets to "..and thus it is obvious that (scribble scribble)" - then he pauses and adds "Well, I think it's obvious... hmm..." He stops and thinks for a bit, scratching his beard. Consults his books and notes - finally looks up triumphantly and exclaims "I was right! It is obvious!"
|
|
|
|
|
I like that, and I'm happy with it! Thanks
|
|
|
|
|
Hi!
I'm trying to write a simple ASP.NET program that read data from wcf service and displays the data in GridView. WCF service works fine. It has simple interface:
[OperationContract]
List<EmployeeDetails> GetEmoloyeesDetails();
[OperationContract]
string ChangeEmployeeDetails(EmployeeDetails employeeInfo);
[OperationContract]
string AddEmployeeDetails(EmployeeDetails employeeInfo);
[OperationContract]
string DeleteEmployeeDetails(EmployeeDetails employeeInfo);
EmployeeDetails is set of string objects:
[DataContract]
public class EmployeeDetails
{
string employeeID = string.Empty;
string firstName = string.Empty;
string lastName = string.Empty;
string birthDate = string.Empty;
[DataMember]
public string EmployeeID
{
get { return employeeID; }
set { employeeID = value; }
}
[DataMember]
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
[DataMember]
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
[DataMember]
public string BirthDate
{
get { return birthDate; }
set { birthDate = value; }
}
}
Now I create ASP.NET with GridView:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" Width = "550px" AutoGenerateColumns = "true" Font-Names = "Arial"
Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"
HeaderStyle-BackColor = "green" AllowPaging ="true" ShowFooter = "true" PageSize = "10" onrowediting="EditEmployee"
onrowcancelingedit="CancelEdit">
<Columns>
<asp:TemplateField ItemStyle-Width = "30px" HeaderText = "FirstName">
<ItemTemplate>
<asp:Label ID="lblFirstName" runat="server"
Text='<%# Eval("FirstName")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField EditText="Edit" ShoweditButton="true" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
This is simple test code (aspx.cs):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class WebForm1 : System.Web.UI.Page
{
ServiceReference1.StaffAccountingServiceClient proxy = new ServiceReference1.StaffAccountingServiceClient();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
private void BindData()
{
GridView1.DataSource = proxy.GetEmoloyeesDetails();
GridView1.DataBind();
}
protected void EditEmployee(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
BindData();
}
protected void CancelEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindData();
}
}
}
I launch my ASP.NET client, and click on Edit link. And I see that dynamically created columns is in edit mode, but staticaly created columns is not
I need to create a static table with the ability to edit. This is example what I want to do:
http://www.aspsnippets.com/Articles/Simple-Insert-Select-Edit-Update-and-Delete-in-ASPNet-GridView-control.aspx[^]
The difference is that I use WCF service to interact with data base.
Please, help me! What could be the problem?
Thanks!
modified 29-Nov-15 12:38pm.
|
|
|
|
|
Greetings experts,
I am not sure what forum to post this question.
So, naturally, I decided to post it on the forum I am a bit more familiar with but I can do this with script, asp, php whichever technology helps me accomplish this.
We would like to programmatically read the contents of logs in referenced on the subject line.
Particularly, we are interested in getting counts of site visits, pages visited, etc from the logs.
This task would have been easier if we had access to the codebehind of the web app built by a vendor.
Only the markup is accessible.
So far, we have been able to get this information from the logs manually and are looking for an opportunity to do this programmatically so our users can get the information they need more easily.
Your assistance is greatly appreciated.
modified 25-Nov-15 12:11pm.
|
|
|
|
|
Microsoft's Log Parser[^] works quite well.
Unfortunately, the site with the documentation[^] seems to be down at the moment. However, Log Parser Studio[^] gives you a GUI which should get you started.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello Richard,
*Always* great to hear from you.
I actually installed that software yesterday but had no idea how to connect it to a remote server.
I uninstalled it.
I am going to attempt to install it again and perhaps you can guide me on how to use it?
Thanks as always.
|
|
|
|
|
The fact that you are doing this remotely is a fairly important piece of information you should have included in your original question.
If you want to access the files remotely you'll need to do it via a UNC, which is the format you use to reference files over a network. If the files are at c:\inetpub\wwwroot\logs on a machine called "MyIIS" then you can access that folder from another machine using \\MyIIS\c$\inetpub\wwwroot\logs. This will need admin rights on the target machine. An alternative is to explicitly share the logs folder so you can control the access rights and use \\MyIIS\logs
|
|
|
|