|
I don't understand what you are trying to do but if you just require to achieve this, then follow these steps:
Add a Table to the new DataSet.
Add Columns to the Table.
Assign these columns to the corresponding columns. Something like
NewDataSetObject.Tables[0].Columns[0] = DataSet1.Tables[0].Columns[0];
I would rather recommend you to explain your scenario and answer these questions:
Where are these data coming from? Why have you taken one DataSet for 1 Table?
Why are you creating another DataSet when you can assign a DataSet, containing these Tables, as a DataSource ?
..Go Green..
|
|
|
|
|
Hi all,
I want to ignore negative while sorting a generic array list.
eg. If list contain following values
0.3
0.2
-0.3
after sofrting it should values should be in following order
0.3
-0.3
0.2
Any solution guyz.
Thanks in advance.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Write a class that implements IComparer .
public class myComparer : IComparer
{
public Boolean Descending;
#region IComparer Members
public int Compare(object x, object y)
{
Double obj1 = (Double)x;
if (obj1 < 0) obj1 = -(obj1);
Double obj2 = (Double)y;
if (obj2 < 0) obj2 = -(obj2);
if (Descending )
{
if (obj1 < obj2 )
return 1;
if (obj1 > obj2)
return -1;
}
else
{
if (obj1 > obj2 )
return 1;
if (obj1< obj2)
return -1;
}
return 0;
}
#endregion
}
Pass a object of your custom class in ArrayList.sort method
ArrayList arr = new ArrayList();
arr.Add(0.3);
arr.Add(0.2);
arr.Add(-0.3);
myComparer objComparer = new myComparer();
objComparer.Descending = true;
arr.Sort(objComparer);
modified on Monday, August 30, 2010 5:31 AM
|
|
|
|
|
you can do some thing like this
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
List<decimal> lstIntCol = new List<decimal>();
lstIntCol.Add(0.3M);
lstIntCol.Add(0.2M);
lstIntCol.Add(-0.3M);
lstIntCol.Sort(new decimalComparer());
foreach (decimal d in lstIntCol)
{
Response.Write(d.ToString() + "--");
}
}
}
public class decimalComparer : System.Collections.Generic.IComparer<decimal>
{
#region IComparer<decimal> Members
public int Compare(decimal x, decimal y)
{
return decimal.Compare(Math.Abs(y),Math.Abs(x));
}
#endregion
}
|
|
|
|
|
When i insert pdf file in database through OLEDB from c sharp asp dot net. and
retreive pdf through OLEDB from c sharp asp dot net then pdf show properly in browser
but when i insert pdf file sqlanywhere 11 database through OLE from power builder 12
and retreive pdf through OLEDB from c sharp asp dot net then pdf show error that
file does not begin with '%PDF-'.
PLEASE HELP ME AS SOON AS POSSIBLE REGARDING THIS MATTER
|
|
|
|
|
Tengo el mismo problema, encontraste la solución?
|
|
|
|
|
I use an access db with my website(.mdb file). I try to run 3 standard sql INSERT, DELETE and UPDATE statements. When I run the website locally on my computer it works great with no problems, but when I upload the website to the server and try to run the SQL statements I get 2 exceptions:
for the Insert statement:
System.Data.OleDb.OleDbException: Operation must use an updateable query.
for the Update statement:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
for the DELETE statement:
System.Data.OleDb.OleDbException: Could not delete from specified tables.
I have to mention that the rest of the site works well with no special problems, including the pages where I read from the db tables by executing sql SELECT statements
|
|
|
|
|
benams wrote: I have to mention that the rest of the site works well with no special problems, including the pages where I read from the db tables by executing sql SELECT statements
It's seems you are having problem with the Writable operation as your "Read" operation working properly and "Insert", "Update", "Delete" is not working.
Please make sure that, In Web Server, you are having (In which credentials your application is running ) proper rights to write access on DB Server.
Hope this will helps !!
|
|
|
|
|
thanks for reply..
how can I check it? (I'm using flashfxp in order to access the server and upload the site's files)
|
|
|
|
|
can anyone guide me to get a asp.net job in UK.
|
|
|
|
|
Look here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Kindly avoid posting this kinda post in Programming forum. Might be you can try Lounge or so.
|
|
|
|
|
Hi Coders
I need to integrate paypal payment gateway in asp.net(C#). I want to use IPN method to get know the transactionId, payment status purpose.
I use sandbox account for this.I made the transaction successfully but it not give me IPN Message(querystring) which have complete detail like txn_id,status etc.I researched over it from last 3 days.
Do any provide a source code or sample application for this.
Thanks in advance
Amit
|
|
|
|
|
You should have searched the CP articles first. Check this[^] out.
|
|
|
|
|
|
Hello everyone,
I am trying to practice regarding OOP. I got a code from internet
public class StoreIndexViewModel
{
public int NumberOfGenres { get; set; }
public List<string> Genres { get; set; }
}
as I am beginner, I am trying to develop code in the way I learn.however it is not professional way.
this is my code regarding above code
namespace TestProject.ViewModels
{
public class StoreIndexViewModel
{
public int _numberofgenre;
public List<string> _genres;
public int Numberofgenre
{
set { _numberofgenre = value;}
get { return _numberofgenre; }
}
public List<string> Genre
{
set { _genres = value; }
get { return _genres;}
}
public StoreIndexViewModel(int numberofgenre,List<string> genre)
{
this._numberofgenre = numberofgenre;
this._genres = genre;
}
Could you please tell me did I write correct code?
thx for your help.
modified on Saturday, August 28, 2010 8:00 AM
|
|
|
|
|
future3839 wrote: Could you please tell me did I write correct code?
Correct in what sense? If it compiles, it is syntactically correct. You can check that yourself. If it does what you want it to do, it is logically correct, may not be the best/optimum logic though.
I think you should describe what do you mean by correct.
Anyways, here are a few things that you may consider:
1. If you are using .Net 3.0 or above, make use of automatic properties.
2. You can make use of XML comments and regions in stead of commenting using "//".
3. You can make your fields private and have them only when it is really needed.
4. No need of having "this" keyword unless really needed.
5. Make use of Generic lists or Collection since they are strongly typed.
modified on Saturday, August 28, 2010 11:14 AM
|
|
|
|
|
future3839 wrote: //definition of Fields
public int _numberofgenre;
public List _genres;
Your field definition need to be private . You have public accessors.
|
|
|
|
|
In addition to the other comments you should use the properties rather than access the fields directly
this._numberofgenre = numberofgenre;
Should be
Numberofgenree = numberofgenre;
This way any logic that needs to be executed when a property is accessed will not be by-passed. Also, if the backing field changes it will not affect the code.
Most coding standards also dictate the use of Pascal casing for properties and methods
Numberofgenre => NumberOfGenre
Many also prefer fields to begin with m_
public int _numberofgenre; => public int m_NumberofGenre;
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I am just trying to learn JQuery.
I want to try out a basic JQuery example. Adding items from one list box to another.
It works fine in the normal aspx page (I pasted it in Default.aspx in root directory).
I placed JQuery Libraries in a folder Javascript under root.
This works fine.
Then I created a WebUserControl and placed the same code and I registerd this user control in default.aspx.
The page loads , but when I click on Add it does not move items from one list to another.
While in the aspx page, I checked the Watch and
innerHTML of the context->childNodes has values "Delhi, Bombai ..........". Same as OuterHTML.
But in the user control with the same code as pasted below.
innerHTML is "" and OuterHTML is "<HTML4F>"
Please throw some light to this
See the code below:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="User_Controls_WebUserControl" %>
<script src="../Javascript/jquery-1.4.1.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
debugger;
$("#add").click(function () {
debugger;
$("#fromListBox option:selected").appendTo("#toListBox");
});
$("#addAll").click(function () {
$("#fromListBox option").appendTo("#toListBox");
});
$("#remove").click(function () {
$("#toListBox option:selected").appendTo("#fromListBox");
});
$("#removeAll").click(function () {
$("#toListBox option").appendTo("#fromListBox");
});
});
</script>
<table>
<tr>
<td><asp:ListBox ID="fromListBox" runat="server" SelectionMode="Multiple" Rows="6">
<asp:ListItem>Delhi</asp:ListItem>
<asp:ListItem>Chennai</asp:ListItem>
<asp:ListItem>Pune</asp:ListItem>
<asp:ListItem>Kolkata</asp:ListItem>
<asp:ListItem>Mumbai</asp:ListItem>
<asp:ListItem>Bangalore</asp:ListItem>
</asp:ListBox></td>
<td> <input id="add" type="button" value="Add" /><br/>
<input id="addAll" type="button" value="Add All" /><br/>
<input id="remove" type="button" value="Remove" /><br/>
<input id="removeAll"type="button" value="Remove All" /><br/></td>
<td><asp:ListBox ID="toListBox" runat="server" SelectionMode="Multiple" Rows="6"></asp:ListBox> </td>
</tr>
</table>
modified on Saturday, August 28, 2010 6:03 AM
|
|
|
|
|
afsal qureshi wrote:
Are you sure there is no changes in javascript script file path after moving your code to user control ?
|
|
|
|
|
I don't think so. I picked up the Src value from the source selector popup.
For Clarification,
JQuery-1.4.1.js resides in stays in Javascript folder in root.
User Control stays in User Control folder and default page stays in the test folder.
Also if path is inorrect we would have got a javacript runitime error
modified on Saturday, August 28, 2010 1:33 PM
|
|
|
|
|
Have you checked the ids that are being rendered are the same you are looking for? Remember the name mangling that ASP.NET applies.
You can check it like this
$("select[id$='fromListBox'])
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi,
im developing a webapplication where i dont want to have a minimize and maximize buttons of the startup page.and i also dont want the menu bar also.
it is urgent requirement for me.
thanks in advance.
|
|
|
|
|
vishnukamath wrote: im developing a webapplication where i dont want to have a minimize and maximize buttons of the startup page.and i also dont want the menu bar also.
Your question is not clear. What do you mean by startup page ? About which menu bar you are talking about ?
vishnukamath wrote: it is urgent requirement for me.
First of all be specific with your requirments and represent it well so that any one can understand and give you answer as quick as possible. Other wise it would be quite difficult to answer.
|
|
|
|