|
ho to add right-click to a "Console" object ?
thanks
|
|
|
|
|
You cant.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
Why on Earth would you want something like that?
I will use Google before asking dumb questions
|
|
|
|
|
|
hi,
I have fetched two database tables "MTQABenchMarks" and "Users" in the datagridview. This is a windows application. Now I have to update the "MTQABenchMark" database after making changes to the datatable present in the application. When I run the code it is throwing an exception "Dynamic SQL generation is not supported against multiple base tables." How to solve this. the code is
public Form1()
{
InitializeComponent();
}
static SqlConnection Con = new SqlConnection("Data Source= 192.168.100.234; Initial Catalog=gishyd; User ID=sa; password=gis*2005");
SqlDataAdapter Da = new SqlDataAdapter("SELECT dbo.Users.UserID, dbo.MTQABenchMark.Id as EmpID, dbo.Users.FirstName + ' ' + dbo.Users.LastName AS Name, dbo.MTQABenchMark.NoofMinPerDay,dbo.MTQABenchMark.PerMonth FROM dbo.Users INNER JOIN dbo.MTQABenchMark ON dbo.Users.UserID = dbo.MTQABenchMark.EID ", Con);
DataSet Ds = new DataSet();
private void Form1_Load(object sender, EventArgs e)
{
Da.Fill(Ds, "MTQABenchMark");
dataGridView1.DataSource = Ds.Tables["MTQABenchMark"];
}
private void button2_Click(object sender, EventArgs e)
{
SqlCommandBuilder CmdBld = new SqlCommandBuilder(Da);
Da.InsertCommand = CmdBld.GetInsertCommand();
Da.Update(Ds, "MTQABenchMark");
MessageBox.Show(" Database is Updated");
}
}
}
Nitin Raj Bidkikar
|
|
|
|
|
Select query can be run against multiple tables, while Update query can be run only one table. In your application you select data from 2 tables, and store it in a dataset. When you try to update the database you use the same dataset. It's not possible, because the application tries to update 2 tables at the same time. You should do a separate update for each table, with values from your dataset.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
how do you suggest to do that
Nitin Raj Bidkikar
|
|
|
|
|
Split the dataset into 2 datasets or datatables that contain fields from only one table, and then use these to update the database.
I will use Google before asking dumb questions
|
|
|
|
|
I won't write the code for you...try to do something and if you get stuck...post a question with your problem.
I will use Google before asking dumb questions
|
|
|
|
|
Hi,
I got a problem that I would like to return a generic object in a non-generic object, what can I do?
I searched a lot of page but it's talking about how to use or implement a generic class, but if I want to implement a normal class and return a generic object according parameter, what can I do?
e.g.
class DaoFactory
{
Dao<T, IdT> GetDao(Type t)
{
//something like this.
//how to implement?
}
}
Thanks
Jr. P
calendarw
|
|
|
|
|
How about this one?
/// <summary>
/// Convert an ArrayList from a derived type to the base type
/// </summary>
/// <typeparam name="S">Derived type</typeparam>
/// <typeparam name="D">Base type</typeparam>
/// <param name="list">The ArrayList</param>
/// <returns>An ArrayList containing elements converted to the base type</returns>
public static List<D> Transform<S, D>(List<S> list) where S : D
{
List<D> lst = new List<D>();
foreach (S element in list)
lst.Add(element);
return lst;
}
I will use Google before asking dumb questions
|
|
|
|
|
Thank you.
I changed to this:
public static List<D> Transform<D>(System.Collections.IList list)
{
List<D> lst = new List<D>();
foreach (D element in list)
lst.Add(element);
return lst;
}
Actually, I tried to search using google but I don't know what keyword should be used for this case.
|
|
|
|
|
How about [this]
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
Thank you for your information.
And I would like to implement something like this:
public interface IReadOnlyDao
{
object GetById(object id);
IList GetAll();
}
public interface IReadOnlyDao<T, IdT> : IReadOnlyDao
{
T GetById(IdT id);
IList<T, IdT> GetAll();
}
But when I implementing the GetAll(), I got a problem that two method are same name and same parameter, is it possible to implement? or I am required to use convert the list using previous discuss method.
Thank you very much.
|
|
|
|
|
I think it will be better to use the converter. My opinion
I will use Google before asking dumb questions
|
|
|
|
|
|
how to add support for "text drag and drop" for a console application in .NET ?
it has to accept dropped text on the console window.
thanks.
|
|
|
|
|
A drop target must be there enabled in the application for it to accept drag and drop requests. Isn't it?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
not sure how I do this for a "Console" object.
|
|
|
|
|
|
hmm interesting, thanks,
still I was hoping for something more human
|
|
|
|
|
Hi...
I have problem with my timer code.
I want to display the data from the sql database on textbox using timer tick event.
For an example there are 3 data in the database which are apple,banana,coconut.
apple will appear first and after 10 seconds banana will appear, and after 10 seconds coconut will appear. And then, after the last data (coconut) appeared, the first data (apple) appeared again, and so on. It will continuously loop.
I want to do like this. Any suggestion or reference?
Thanks
Jac
|
|
|
|
|
jacklynn_mei wrote: It will continuously loop.
If you are looking at providing some interactive DHTML effect, I would suggest you look into:
http://script.aculo.us/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Do you want to do this in a web or desktop application?
I will use Google before asking dumb questions
|
|
|
|
|