|
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
|
|
|
|
|
|
Then, why don't you just query the database, store what you have retrieved in an object, DataSet, List...whatever...and then at the specified interval you just show a value form that object (you can use in this case a counter too).
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
I have done something like the code below
But after reading the last data, it encounter error since there is no data persistent while reading.
public partial class tempA : Form
{
SqlDataReader m_Reader;
DataSet ds = new DataSet();
private void tempA_Load(object sender, EventArgs e)
{
string conStrg;
conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456");
SqlConnection connTimer = new SqlConnection(conStrg);
connTimer.Open();
string selSQL = "Select txtDesc FROM txtScroll";
SqlCommand com = new SqlCommand(selSQL, connTimer);
SqlDataAdapter da = new SqlDataAdapter(com);
da.Fill(ds, "txtScroll");
m_Reader = com.ExecuteReader();
m_Reader.Read();
Timer myTimer = new Timer();
myTimer.Interval = 5000;
myTimer.Enabled = true;
myTimer.Start();
myTimer.Tick += new EventHandler(Timer_Tick);
}
public void Timer_Tick(object sender, EventArgs e)
{
alphaTxtMain.Text = " " + m_Reader["txtDesc"];
m_Reader.Read()
}
}
|
|
|
|
|
public partial class tempA : Form
{
SqlDataReader m_Reader;
DataSet ds = new DataSet();
int counter = 0;
private void tempA_Load(object sender, EventArgs e)
{
string conStrg;
conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456");
SqlConnection connTimer = new SqlConnection(conStrg);
connTimer.Open();
string selSQL = "Select txtDesc FROM txtScroll";
SqlCommand com = new SqlCommand(selSQL, connTimer);
SqlDataAdapter da = new SqlDataAdapter(com);
da.Fill(ds, "txtScroll");
m_Reader = com.ExecuteReader();
m_Reader.Read();
Timer myTimer = new Timer();
myTimer.Interval = 5000;
myTimer.Enabled = true;
myTimer.Start();
myTimer.Tick += new EventHandler(Timer_Tick);
}
public void Timer_Tick(object sender, EventArgs e)
{
alphaTxtMain.Text = " " + ds.Tables[0].Rows[counter++]["txtDesc"];
}
}
I will use Google before asking dumb questions
|
|
|
|
|
Thanks...
But after tried, it wont loop to the first data. After reading the 3rd data, it will error since there is no data on the position 3 (4th data) (my table only have 3 data).
|
|
|
|
|
Do we have to do everything for you? Test the counter...if it reaches the end of the DataSet, set it to 0.
I will use Google before asking dumb questions
|
|
|
|
|
Thank you very much...You've help me a lot...
Thank you...
|
|
|
|
|
Glad it turned out alright.
I will use Google before asking dumb questions
|
|
|
|
|
Hi, I've tried to open a file that is placed in a folder of web application in a editor that is made using windows application. Let us suppose i have a folder in http://localhost/MySite/MyFolder/doc.doc. Now what i need to do i want to open this file in that editor. I also want to display the file names of MyFolder. Please help me out and let me know is there any way to do so. It will be very nice of you.
Arslan Ilyas
Red Signal
|
|
|
|
|
arslanjatt wrote: a file that is placed in a folder of web application
How about a HttpWebRequest?
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
|
|
|
|
|
I've tried this one but by using this i can read the contents of page. But i want to open a word file. It only read the html of that page. I've tried this one. Is there anything else? Thank you any ways
|
|
|
|
|
|
Hi all,
I am using StreamWriter to create a .txt file with the help of a counter. Which means, if a file is created, the title would be message1.txt. if a second file is created, the title would be message2.txt. The counter will increase everytime the button is clicked. eg. ( "message" + intCounter + ".txt")
However, when the program is closed and run again, the new content of the textbox overwrites message1.txt instead of creating a new file named "message3.txt".
I've heard of the command File.Exists so that the program checks for the latest number of the counter so that it can continue with the next number.
How is this done?
|
|
|
|