|
|
Hi,
I have a table like
Sno ReceiptNo CustomerId Amount Date commissionAmount AgentId
1 10 C96 5000 02/02/2009 500 A20
2 10 C96 5000 02/02/2009 300 A46
3 10 C96 5000 02/02/2009 200 A37
4 11 C50 3000 02/03/2009 300 A35
5 11 C96 2000 02/03/2009 200 A43
here one receiptid have multiple records with same customer.
this table contains multiple records with the same receiptno and customer id.but i want to add distinct amount of each receipt of perticular custimer. means here customer C96 total paid amount is 5000+2000 i.e 7000.
I want query for this.If any one give the answer it will be very useful for me . Thanks in advance.
Haritha.
Haritha
|
|
|
|
|
HI Haritha.........
SELECT SUM(amount) FROM customer WHERE ReciptNo IN (SELECT DISTINCT ReceiptNo,amount FROM customer WHERE CustomerId='C96')
najmalccl@gmail.com
|
|
|
|
|
Haritha, use the following query this will help you:
Select sum(Amount) as Amount_Sum from Customer group by CustomerId
|
|
|
|
|
Either of these will work if using sql server
with temp (ReceiptNo, CustomerID, Amount)
as
(
SELECT ReceiptNo, CustomerID, Amount
FROM customer
group by ReceiptNo, CustomerID, Amount
)
select CustomerID, sum(Amount) from temp group by CustomerID
GO
SELECT ReceiptNo, CustomerID, Amount
INTO [#temp]
FROM customer
GROUP BY ReceiptNo, CustomerID, Amount
select CustomerID, sum(Amount) from #temp group by CustomerID
GO
drop table #temp
GO
|
|
|
|
|
Why the H are you using temporary tables for that?
|
|
|
|
|
|
select distinct receiptno from tablename...
i will displays all records without duplicates then u can fine total amount of all records ...or particular customer records...
|
|
|
|
|
Hi,
I want to change the font of a specific column in C#.Net 2003 while the rest ramains in the default font. For example I want column 11 has the font "Times ..." while others have the font "Arial". How should I do this? Thanks in advance.
|
|
|
|
|
VS2003 use old DataGrid control. Maybe switch to VS2005 or VS2008. There is better support for data grids.
|
|
|
|
|
Hi all
I am trying to convert .flv file to .3gp file but is it possible to convert it through C# coding ?
or is there any dll which will help me to do that?
thanks
Amitava
AmiAmitava
|
|
|
|
|
I'm sure it's possible, you just need to know the two formats and write code to go between them. Assuming they are even compatible, I have no idea what they are,
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
When I need to convert video formats, I execute an external process called ffmpeg. That's the best shortest way to do what you're trying to do.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all,
I've a string in rtf format and I want to get plain text from there. But the rtf string is in Unicode and additional space is there after each character. It cause to get the pain text from RichTextBox. How can I solve this matter?
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
It sounds like you have a string encoded as UTF-16 , and decode it using a different encoding. Each chatacter is two bytes, so for all regular characters every second byte is zero.
Use the Encoding.UTF16.GetString method to decode the data into a string.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
HI,
This is from Chandrakanth working on C#.net with Asp.net with SharepointMOSS 2007.
Actually we are updating data into DataBase by clicking button.
And some of scanned files are going to store in Application Directory.
That name of the application directory is TiffFiles.
Actually the process goes in this below format.
1) We are entering user credential for Login.
2)We are selecting one folder from DROPDOWN. That folder contain Scanned files.By clicking BUTTON RETRIVEDATA the data will be going to store in DataBase, and Files are going to store in TIFFFOLDER.That Folder in Application.
2) And by Clicking WORKFLOW BUTTON the files should move to Folder in Sharepoint Server.The Name of the Folder in Sharepoint Server is SCANNED FILES.
Now the Problem is FILES are not moving to Folder in Shrepoint Server.
Here i am giving code and all. Can any one tell me how to Solve the Problem.
private void readdata(string batch)
{
string strConnection = (string)ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection con10 = new SqlConnection(strConnection);
SqlCommand cmd10 = new SqlCommand();
cmd10 = new SqlCommand("select * from T_Invoice_Data where BatchName='" + batch + "'", con10);
con10.Open();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da = new SqlDataAdapter(cmd10);
da.Fill(ds, "T_Invoice_Data");
DataTable dt;
dt = ds.Tables[0];
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
DataRow dr = dt.Rows[i];
string x = dr[0].ToString();
string x1 = dr[1].ToString();
string x2 = "Invoice4.TIF";
string x2 = dr[2].ToString();
string x3 = dr[3].ToString();
string x4 = dr[4].ToString();
string x5 = dr[5].ToString();
string x6 = dr[6].ToString();
string x7 = dr[7].ToString();
string x8 = dr[8].ToString();
string x9 = dr[9].ToString();
string x10 = dr[10].ToString();
string x11 = dr[11].ToString();
SPSite msite = new SPSite("http://sys245:44486/ScanDocuments");
SPWeb mweb = msite.OpenWeb();
mweb.AllowUnsafeUpdates = true;
string path = @"c:\AuroBindoUsingGoogleOCR\Tiffiles\";
string path2 = path + x;
if (File.Exists(path2))
{
FileStream fStream = File.OpenRead("C:\\AuroBindoUsingGoogleOCR\\Tiffiles" + "\\" + x);
fStream.Read(fileContent, 0, (int)fStream.Length);
fStream.Close();
SPListCollection splist = mweb.Lists;
SPList splis = splist["ScanDocuments"];
string createddate;
createddate = Convert.ToString(DateTime.Today.Day + "_" + DateTime.Today.Month + "_" + DateTime.Today.Year);
splis.RootFolder.SubFolders.Add(x6);
SPFolderCollection folders = mweb.GetFolder("http://sys245:44486/ScanDocuments/" + x6).SubFolders;
folders.Add(createddate);
SPFolderCollection folders2 = mweb.GetFolder("http://sys245:44486/ScanDocuments/" + x6 + "/" + createddate).SubFolders;
folders2.Add(batch);
SPFileCollection f02 = mweb.GetFolder("http://sys245:44486/ScanDocuments/" + x6 + "/" + createddate + "/" + batch).Files;
f02.Add(x, fileContent, true);
SPSite msite1 = new SPSite("http://sys245:44486/");
SPWeb mweb1 = msite.OpenWeb();
mweb1.AllowUnsafeUpdates = true;
SPList list = mweb1.Lists["ScanDocuments"];
SPListItemCollection items = list.Items;
foreach (SPListItem item in items)
{
string l1 = item.Name.ToString();
if (l1 == x)
{
item["FileName"] = x;
item["InvoiceNo"] = x1;
item["InvoiceDate"] = x2;
item["PO NO"] = x3;
item["TotalAmount"] = x5;
item["Location"] = x6;
item["Batch"] = x7;
item["CStaff"] = x8;
item["AssignedTo"] = x9;
item["DelFlag"] = x10;
item["ReOCRFlag"] = x11;
item["PODate"] = x4;
item.Update();
}
}
}
}
}
Thanks and Regards
Chandrakanth
|
|
|
|
|
Hi Friends,
In my project, I am able to call server side function from javascript in which i am inserting data in DropDownList,But the DropDownList is not showing the data. I am using C#.net .
Regards,
Atul Rane
|
|
|
|
|
I'd say you have two issues
1 - you're not asking in the right forum
2 - your code is broken.
Your error is hard to point out when you didn't post any code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I created small application of BHO in c# using http://www.codeproject.com/KB/cs/Attach_BHO_with_C_.aspx?fid=447248&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=51&select=2421069
I want to change the web page text totally on page loading, and i want the changed content should be seen by user directly instead of original text.
How can I do this?
In the following link http://msdn.microsoft.com/en-us/library/aa752299(VS.85).aspx
it has given that, we can change the value of the title element using the document.title property and to change the content of a particular cell, use the IHTMLElement::innerHTML property.
I was changing the title element as it is, but How can I change the element's text present in document.body?
Any suggestion can be appreciated...
actually, I was changing the individual element's text with the help of IHTMLElement::innerText property, but the original text is visible to user for a fraction of second and then the original content is replaced by other text. i.e., there is some delay in replacing the original content, how can I avoid this?
I want the changed content should be directly visible to user.
I had already posted it in .Net framework forums...
I think this is the right forum to this
|
|
|
|
|
|
1.listen the mouse click and move events.
2.Check the method - RotateTransform of Graphic object. E.g.
gfx.RotateTransform(rotationAngle);
I Love KongFu~
|
|
|
|
|
Hi,
I have a DataGridView that displays the UserID and FirstName. I want to change the FirstName to a LinkLabel so that when the user click the firstname a second form will popup with the details of that user.
For example:
When I click test1 it should display the ID and firstname of test1 in form 2.
Can anyone shed some light on this? I have been able to add the linkcolumn but how can I pass the needed variables to retrieve the records?
Thank you!
Illegal Operation
|
|
|
|
|
If you haven't done so already you would want to set your gridview to not auto generate the columns.
Example:
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
Within the GridView declaration, declare a <columns> element.
Within the Columns element, define the <asp:hyperlinkfield> you intend to display, specifying at the very least the required DataTextField and DataNavigateUrlFields properties.
Optionally set the HyperLinkField control's other properties, such as the HeaderText and DataNavigateUrlFormatString. For syntax, see GridView Control Syntax.
Example:
<columns><asp:hyperlinkfield headertext="User" datatextfield="UserName" datanavigateurlfields="UserName" datanavigateurlformatstring="hostmysite.com">
Also you can check out the msdn which provides a lot of helpful information for the gridview. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx[^]
Matthew Vass
QA Analyst
mvass@hostmysite.com
http://www.hostmysite.com?utm_source=bb[^]
|
|
|
|
|
|
Hi
I am attempting to use FileSystemWatcher but get an error at 'OnChange' in the code following.
I've referenced System.IO but there is still something I am missing.
Help would be much appreciated.
Bob
private FileSystemWatcher _fileWatcher;
internal void InitializeWatcher(FileInfo configurationFile, IList<string> configurationSections)
{
_fileWatcher = new FileSystemWatcher
{
Path = "C:\\IDW32\\Library",
Filter = "P&ID.txt",
NotifyFilter = (NotifyFilters.CreationTime | NotifyFilters.LastWrite |
NotifyFilters.FileName)
};
_fileWatcher.Changed += OnChange;
_fileWatcher.EnableRaisingEvents = true;
|
|
|
|