|
Any pointers, suggestions, links, hints on making an enterprise app database independent... Thanks…
Salil Khedkar [^]
|
|
|
|
|
there are many O/R Mappers which try to be database indpendent they differ of the number of database they support there some free like NHibernate[^]
try to google O/R Mapping
MCAD
|
|
|
|
|
Here is a small example which i did,
Create a form with button, label, textbox, and progressbar on it (I just use the default names in this example).
Create two methods on the form, one that updates the label, and one that updates the progress bar.
Code:
private void UpdateLabel()
{
label1.BackColor=Color.Red;
}
private void UpdateProgress()
{
progressBar1.PerformStep();
}
Create a class that does the thread work, in this case it will start a timer, and invoke methods above for the form each time the timer elapses.
Code:
private class ThreadRunner
{
private Form1 _form;
private int _delay;
private System.Threading.Timer _timer;
public ThreadRunner(Form1 mainForm,int delayInSeconds)
{
_form=mainForm;
_delay=delayInSeconds;
}
public void Go()
{
_timer=new System.Threading.Timer(new TimerCallback(this.TimerElapsed),null,0,10);
while (_timer!=null)
Thread.Sleep(0); // Do nothing until timer has stopped
}
public void TimerElapsed(object o)
{
_delay--;
_form.Invoke(new MethodInvoker(_form.UpdateProgress));
if (_delay<=0)
{
_form.Invoke(new MethodInvoker(_form.UpdateLabel));
_timer.Dispose();
_timer=null;
}
}
}
Add code to start an object of the class defined above:
Code:
private void button1_Click(object sender, System.EventArgs e)
{
int timeToRun=Int32.Parse(textBox1.Text);
progressBar1.Maximum=timeToRun;
progressBar1.Step=1;
ThreadRunner tr=new ThreadRunner(this,timeToRun);
Thread t=new Thread(new ThreadStart(tr.Go));
t.Start();
}
Inthis u can see that for a specify seconds in the textbox, ,label glows red after the progress bar completes.
so now wht i need is that to do another thing in the above example,that is ..that giving a time in
the text box....say 3:00 pm....
then the label should turn red at 3:00pm..
i mean giving the system timing ,... then we should give a time in the text box,
then the button click property should be done at the specified time in the text box.
how can i do this in the above method....please can u help me to do this.
js
-- modified at 3:39 Tuesday 13th September, 2005
|
|
|
|
|
how do i get the index of first visible row in datagrid
bye
|
|
|
|
|
i found ...
FieldInfo fi = typeof(DataGrid).GetField("firstVisibleRow",BindingFlags.NonPublic | BindingFlags.Instance);
int rownum = Convert.ToInt32(fi.GetValue(dataGrid1));
|
|
|
|
|
I have a combobox in my c# windows application. I want to store two values in a combobox item.
Add method in the combobox class allows add only one variable and we can call the value by
combobox.SelectedItem.ToString();
but i want to store additional variable.
Example: I want to add student name in the combo box with student id.
Please Help!!!
Thanks
|
|
|
|
|
You can add whatever you want to the combobox Item collection - it's a collection of object s!
What's being displayed in the combobox is the result of an item's ToString() method, so if you create a class Student with name, id, ... and then override ToString() to return just the name that's exactly the way to go.
Regards,
mav
|
|
|
|
|
An example of what Mav told you
public class ComboItemEx
{
private int id;
private string name;
private string address;
public int ID
{
get
{
return id;
}
set
{
id=value;
}
}
public string Name
{
get
{
return name ;
}
set
{
name=value;
}
}
public string Address
{
return address;
}
set
{
address=value;
}
public override ToString()
{
return name;
}
}
and some where you can add it
CombobItemEx cbi=new CombobItemEx();
cbi.ID=44;
cbi.Name="my name";
cbi.Address="my address"
comboBox1.Items.Add(cbi)
MCAD
|
|
|
|
|
Hey, I need to authenticate a user in windows ,when he tries to access my machine,I want to do it in the same way,as it happens in Windows using Tokens.I have to implement it in .Net Framework1.1 ,plz help its urgent
|
|
|
|
|
akshayswaroop wrote:
when he tries to access my machine
That's really vague. If your talking about the shared resources on your machine, Windows authenticates the credentials automatically. A better explanation of what your trying to do would help greatly.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Microsoft.Samples.Security.SSPI this is the answer to my problem
|
|
|
|
|
You never really explained what your problem was...
But I'm glad you found something that works for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi i want only doc files to open in windows form in uneditable mode.
Thanks
|
|
|
|
|
Hi there,
I would like to write a program for data socket with GPRS connection.
My smartphone, Dopod 585, is as the client and PC is the TCPserver.
To deliver string from smartphone and show it on PC is my current task.
However, I can do that via USB connection but failed in GPRS.
It seems to mean that both programs in client and server are correct but something wrong in GPRS connection.
Maybe I need to write a program in C# to start GPRS connection.
However I could not get any information about GPRS connection in the MSDN for C#.
Would you please do me a favor to give a example program or tell me what function or structure could accomplish GPRS connection? Thanks for your kindly assistance.
Sincerely yours,
Kuan-chu
-- modified at 3:28 Wednesday 14th September, 2005
|
|
|
|
|
How to let the user to input the URL of the target Web Server to access web service. (All the different Server have the same web service call)
Example.
User can input http://192.168.1.3/abc.asmx to use ABC web serivce
also, user can input http://192.168.1.6/abc.asmx to use ABC web service too
as both URL have the same web service
KT
-- modified at 23:20 Monday 12th September, 2005
|
|
|
|
|
The Client generated by WSDL or a WebReference has a Url property. If you set that before making any method calls then it will use that instead of the value from registration.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I am tryin to develop a app that will run in teh background on a system, it needs to be able to access a webpage (eg http://1.1.1.1/web/user/webDocBox/FileList.cgi), it then has to be able to retrieve the images stored on the web site, then be able to move to the next page of images (there are usually abotu 5 pages).
the problem im having is that all 5 (eg number) pages have the same URL address (the one listed above), and turning the page is controlled by a javascript function, i didnt write (and have no exp) the javascript function, and im having trouble being able to find a way to get the app to change the page, i have tried posting the javascript function with HttpWebRequest, but the only result i am getting is it simply changes to page 1, everytime.
If anyone can help me with this issue, id really appreciate it
I am tryin to developin useing a C#.NET windows application, is this possible, or do i need to make it a c# ASP.NET project?
(NOTE: THE URL USED ABOVE IS JUST AN EXAMPLE, ITS NOT THE REAL ADDRESS)
thanx in advance,
Thaynann
-- modified at 23:13 Monday 12th September, 2005
|
|
|
|
|
Fiddler[^] will probably help you out. It's a logging proxy that will let you capture your web traffic and replay it to make sure you get all the headers and post information correct. Once you have that it should be easy to translate it into httpwebrequest calls.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanx for the link, its alot better then TcpTrace (even though they both return the same data), my main problem is that when i want to turn the page of images (ie from 1/5 to 2/5) the URL stays the same, and im not sure how to set up a POST to be able to let me move through the pages, grabbing the URLs of the JPG files on each page (basic functionality). heres a sample POST that fiddler returns when i attempt to change pages (in its raw form)
POST /web/user/en/webdocbox/faxDocListPage.cgi HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://1.0.0.1/web/user/en/webdocbox/faxDocListPage.cgi
Accept-Language: en-au
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host: 1.0.0.1
Content-Length: 612
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: risessionid=171415779234873; cookieOnOffChecker=on
offset=24&resultRowBlockSize=12&matrixColSpan=4&show=thumbnail&displayedDocIds=30946&selectFlags=false&displayedDocIds=30944&selectFlags=false&displayedDocIds=30942&selectFlags=false&displayedDocIds=30940&selectFlags=false&displayedDocIds=30938&selectFlags=false&displayedDocIds=30936&selectFlags=false&displayedDocIds=30934&selectFlags=false&displayedDocIds=30932&selectFlags=false&displayedDocIds=30929&selectFlags=false&displayedDocIds=30927&selectFlags=false&displayedDocIds=30921&selectFlags=false&displayedDocIds=30919&selectFlags=false&orderBy_property=ReceivedDate&orderBy_descendingRequested=true&dummy=
Im not sure what the section at the bottom does, but it appears in every request i send to turn a page (although the values are different), i am very new to handling apps in regards to Web aspects and i am a little lost with all this.
any help that anyone can provide, will be greatly appreciated
thaynann
-- modified at 1:18 Tuesday 13th September, 2005
|
|
|
|
|
The section at the bottom is the post information. It is just like the informaton in the query string but it put in a different location on the request. The value of the content-Length must match the length of the post data. You are going to have to figure out what the next page is expecting based on the last page sent, which shouldn't be too hard since you have the javascript code, you just have to reproduce what it does in C#.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
thanx for your reply, i managed to figure out the POST data, i just simply have to grab the DisplayedDocIds values from the current page (they are hidden input vals, but do appear in the HTML code), then simply plug it into that data string, (i tried this in a test and also by using fiddler to compare 2 consecutive pages, and it works, should be a simple thing to implement, thanx for your help andy, ive been lookin for 4 days for an answer to this problem, with the info of wat the exact post data is, the rest should be easy to implement.
Thanx again
|
|
|
|
|
Hi All,
I am unable to close Microsoft Excel object from Task Manager.what i am doing as follows ************ Sample Code*********************
Excel._Application _excel = new Excel.ApplicationClass();
Excel.Workbook wsWorkbook = _excel.Workbooks.Open(@"C:\test.xls",0, false, 1, "", "", false, Excel.XlPlatform.xlWindows, "",true, false, 0, true, false, false);
Excel._Worksheet sheet = (Excel._Worksheet)wsWorkbook.ActiveSheet;
sheet.Activate();
((Excel.Range)sheet.Cells [1,2]).EntireColumn.NumberFormat =0;
((Excel.Range)sheet.Cells [1,2]).EntireColumn.AutoFit();
((Excel.Range)sheet.Cells [1,3]).EntireColumn.NumberFormat ="$#,##0.00";
((Excel.Range)sheet.Cells [1,3]).EntireColumn.AutoFit();
wsWorkbook.Close(true,missing.Value,missing.Value );
// _excel.Visible = true;
_excel.Quit();
MessageBox.Show("Done");
**************code end here*******************8
I am opening existing .xls file using C# and formatting some columns.
It doesn't release object from Task manager memory.
I used Excel.quit() and excel.close();
Please let me know why is object not realsed.
Thanks & Regards
Rao
|
|
|
|
|
Add this in the end to release the objects
wsWorkbook = null;
_excel = null;
|
|
|
|
|
|
[DllImport("user32.dll", EntryPoint="GetWindowThreadProcessId")]
public static extern uint GetWindowThreadProcessId(int Hwnd, ref int ProcessID);
private int importExcelProcessID = 0;
Do this in the beginning
Excel._Application _excel = new Excel.ApplicationClass();
GetWindowThreadProcessId(_excel.Hwnd, ref this.importExcelProcessID);
When the App ends do this
if (this.importExcelProcessID != 0)
{
Process.GetProcessById(this.importExcelProcessID).Kill();
}
|
|
|
|
|