|
Hi
It seems like you are looking for the indexer operator under the VB.
In order to read the field values use one of the following methods:
1.indexer operator - dr["Password"] or dr[index]
2.GetValue - dr.GetValue(index)
3.GetValues - int count = dr.GetValues(object[] results)
|
|
|
|
|
I require a drill-down feature in one of my application (exactly similar to Data Tips in Visual Studio .NET 2005).
Here's a brief on what I have:
1. I receive the final output through several steps (say 5 steps) and I need to display the output at each step.
2. Each sub-output has different number of parameters (or you can say No. of Columns)
Considering this, I think something like Data Tips would be the best option for presenting this data to the user.
Problem is that I don't know how to re-create or derive this existing Visual Studio's feature. I am a beginner in C#. I searched everywhere, but all I got was DebuggerVisualizer (which works only in debug mode of Visual Studio and they are not about creating Data Tips).
I want Data Tips to work outside of Visual Studio, in my own application.;)
|
|
|
|
|
i want to make a schedule for distributing employees over a month ,using genetic algorithm & C#
can anyone tell me plz how to proceed ?
|
|
|
|
|
I would say that to proceed, you should do the following:
- 1. Understand genetic algorithms
- You can do that by reading the Wikipedia entry[^] or a good tutorial[^].
- 2. Figure out an acceptable encoding
- The hardest part of genetic computing comes from creating an encoding that represents the appropriate information on which the algorithm can act.
- 3. Write some code
- You can always use Google to find example code.
Unfortunately, this may be all that you get. This sounds suspicious like a homework assignment; we don't do homework for people.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi, This provides usefull methods to get tempfiles, unuque name, and temp directory paths, i m wondering if i can show my files let say in folder "PDF", which is not publicaly viewable, in that temp file, which is unique for each user session.
Problem: I have pdf files in PDF folder on which each asp.net user have different rights, some can view the same files and some can not, so i planned to make it restricted for all user, and will get rights from the dataabse, and finally i want to copy these file to uniquly created temp file, and want to redirect to that file, so user can see the file in browser. i hope you understand my question.
many thanks
adnan
-- modified at 10:39 Sunday 26th August, 2007
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
Hi Adnan,
You might find copying the files around will give poor performance, its probably not the best solution to your problem.
It seems the root cause of your problem is that ASP.Net permissions don't apply to passive content like PDFs, am I correct?
If so you might want to read up on how to stream a file using a handler (ashx). You could then have a URL like "http://mysite/viewPDF.ashx?somefile.pdf". If you want a normal looking URL to hide what you are doing you will have to read about URL remapping.
Have a search on this site, theres lots of articles about those topics.
Cheers,
|
|
|
|
|
Thanks for reply. But now i am confused to go for a reliable solution regarding file security.
Its right that asp.net location tag didnot work for like it did work for common aspx pages.
I read articles which advocates different solutions, like implementing basic authentication with SSL, to secure the files, and use httpwebrequest type classes to get login on the server and give access to the logined user without prompting a login diaglue.
Some advocate NTLM security, which is new even i heard first time.
You told me to write handelers, i read a little about it, to map IIS extensions with asp.net extension to restrict file access in browser.
But my real problem is i will be having thousands of files, and with hunderd of users having different writes on them, I am looking to having a reliable solution which should also be good in performance.
Can you please put little more light regarding my context explained above.
I will be very thankful to you.
Many Thanks & Best Regards,
adnan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
Hi Adnan,
A handler can be made that will serve out many different files. I'm not going to write one for you, but I can give you some code snippets to give you an idea. (I'm also typing straight into the reply window, so they might be a little wrong).
Firstly you would need some way of identifying what file the user wants, and mapping that to a real file. Lets just assume they are all pdf files in one directory, and the user will ask for them by filename in the querystring (http://yoursite/getFile.ashx?SomeFileName).
So in our handler we can get the file the user wants with the Request.QueryString. Then we can check whether the user has permission to access the file (how you do this is up to you). Then we can send the file to the client.
We want to set the context.Response.ContentType = "text/pdf" (or whatever is appropriate).
We need to find the physical filename of the file, say string filename= "c:\\somedirectory\\" + filename + ".pdf". Then we can use context.Response.WriteFile(filename) to send the file to the client.
Note that you probably want to check the user's input more carefully than I have.
|
|
|
|
|
Thanks Mark, handler works greate for me. regards adnan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
can anyone walk me through how to do this or point me to a resource? My friend google couldn't find me anything about how this is done. I don't mean having another application interact with the service by attaching it to the service process. I would like to step through the code within the service itself.
TIA!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Sure, I do that all the time (but not on remote systems, I only know how to do local services).
In Visual Studio, under Debug, there is a menu item to Attach to Process...
use that to attach to the service process while it's running.
As a further help to me, in my OnStart I put
# if DEBUG
System.Threading.Thread.Sleep ( 60000 ) ;
# endif
so the service sleeps for a minute before starting, giving me time to attach the debugger.
|
|
|
|
|
Thanks for the reply.
Just a couple more question...When you say attach to the server process, what do I attach? Do you mean to attach another application that will communicate to the service? Or do you mean the service application itself? The former I can do but when I run in debug the currently opened service solution I get an error saying I can't run the service that way and it has to be installed or run using the server explorer or net start.
It would be really great if I can step through the code of the running service.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Write the service.
Make a debug build.
Install the service.
Start the service.
Attach the debugger -- Visual Studio -- to the process that is the service. That service has to already be installed and running (or at least asleep in its OnStart method).
|
|
|
|
|
Use the diagnostics namespace:
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif
This will launch and attach a debugger to the process. Theres a bunch of other useful methods on that class as well.
|
|
|
|
|
hi
i have a main form, when i click on button, the datails form show via showdialog() method, in DetailsForm_Load event, i use delegate to loading data from another thread, here is my code :
myDelegate delInctance = new myDelegate(this.gu2.Show_WaitingForm);<br />
delInctance.BeginInvoke("در حال بارگذاري اطلاعات ...", null, null);<br />
if (this.isNewMode)<br />
{<br />
this.LoadLookUp_TypeResource();<br />
this.LoadLookUp_Group(); <br />
<br />
this.bar_btn_edit.Enabled = false;<br />
this.bar_btn_delete.Enabled = false;<br />
<br />
this.barStaticItem1.Caption = "آماده";<br />
}<br />
else if (this.isEditeMode)<br />
{<br />
this.LoadLookUp_TypeResource();<br />
this.LoadLookUp_Group();<br />
this.InitData();<br />
this.dataNavigator1.Position = this.currentRowIndex;<br />
this.barStaticItem1.Caption = "آماده";<br />
}<br />
this.gu2.Hide_WaitingForm();
but when i load event, finish operation, my form and my app get lost focus window, how to solve my problem and keep focus on my DetailsForm ?
thanks
|
|
|
|
|
SELECT COL1,COL2,SUM(COL1,COL2) AS COL3 FROM TEST;
THAT, sounded logical to me but it's not working!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
sum will add all values for a single column and give a total. Try col1 + col2 as col3, and in future try reading the docs instead of guessing, and try defining 'it's not working' when you ask a question.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Oops, sorry
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Also, the SELECT COL1, COL2 part will return one row for each row in your table. The SUM function will return only one row no matter how many you have. They are not compatible like that, without grouping by something. See GROUP BY docs.
|
|
|
|
|
Dear all,
i made a package using set up and deployment project of visual studio. now every time i made a change in my code i just recompile the package and i get the new package.. it just happened that i got the spelling of product wrong. To make the setup again very is lengthy process. how can i just rename the setup package and recompile the setup..
i.e i have a package name stepup1 i need to rename it as setup1. Is there any way.
|
|
|
|
|
Hello,
my utility works ok on small data samples, but it's throwing an "Out of memory" exception on me whenever I try to apply it on a bigger data sample (a couple of hundred MBs). The exception is thrown during the sort.
Is this a physical limitation of the DataTable or am I missing something?
This is the dump of the exception description:
System.OutOfMemoryException was unhandled
Message="Exception of type 'System.OutOfMemoryException' was thrown."
Source="System.Data"
StackTrace:
at System.Data.RBTree`1.TreePage..ctor(Int32 size)
at System.Data.RBTree`1.AllocPage(Int32 size)
at System.Data.RBTree`1.GetNewNode(K key)
at System.Data.RBTree`1.Insert(K item)
at System.Data.Index.InitRecords(IFilter filter)
at System.Data.Index..ctor(DataTable table, Int32[] ndexDesc, IndexField[] indexFields, DataViewRowState recordStates, IFilter rowFilter)
at System.Data.DataTable.GetIndex(IndexField[] indexDesc, DataViewRowState recordStates, IFilter rowFilter)
at System.Data.DataView.UpdateIndex(Boolean force, Boolean fireEvent)
at System.Data.DataView.UpdateIndex(Boolean force)
at System.Data.DataView.SetIndex2(String newSort, DataViewRowState newRowStates, DataExpression newRowFilter, Boolean fireEvent)
at System.Data.DataTable.get_DefaultView()
at TickConvertor.Program.Main(String[] args)
Thanks much for any input!
Michal
|
|
|
|
|
Seems like using DataTable.Select() instead of the DataTable.DefaultView.Sort might be the solution.
Michal
|
|
|
|
|
DataTable.Select() is throwing the same exception.
Any ideas?
Thanks,
Michal
|
|
|
|
|
Hi, I was wondering if theres a utility that can convert C# projects to vb.net projects (2005). I know there are many free converters online, but I cannot find any that can convert project files. I do have one, but its for the older 2003 files. Any ideas?
|
|
|
|
|
There are numerous commercial products that do this. I've used them in the opposite direction and found that the same one worked great for a winforms app, and terribly for an ASP.NET app. Having said that, VB being weakly typed, I'd expect a conversion from C# -> VB to go smoother.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|