|
hi i need a help for how i convert all excel sheet data in sql as a table
i have 800 records in 1 sheet.need only logic behind that
|
|
|
|
|
Use OLEDB and read data from excel. Loop through the records and insert each row into DB table. If your DB is SQL server, you can use SQLBulkCopy[^] as well.
|
|
|
|
|
i am using sql 2005 server
|
|
|
|
|
please send me key in the project stegnography for data hiding in midisongs and how to run it. the project download form the site code poject .com
|
|
|
|
|
|
Hi,
I am trying to come to grips with Vista UAC and am having problems understanding the following....
My installer software (InstallAware) uses $ALLAPPDATA$ as a pointer to the environment variable 'common user data' which prior to Vista was c:\documents and settings\all users\application data\program name etc' . In Vista it becomes 'c:\programdata\program name etc'.
The installer installs all the data files in either Vista and XP etc OK but when the user runs my program in Vista, my program says it can't access the data files. Disabling the UAC fixes the problem.
I specifically use InstallAware to set permissions for all users to have read write access to the $ALLAPPDATA$ folder.
Can someone tell me what I am missing?
Thanks...
Glen Harvy
|
|
|
|
|
You might be missing a few Vista rants
Anyway, turning UAC off solves the problem, so, the solution is turning UAC off. What do you need it for anyway?
|
|
|
|
|
harold aptroot wrote: What do you need it for anyway?
When someone downloads my program to test it out, the last thing I want them to have to do is send me an email saying - it doesn't work
I would think many would just uninstall it and I've lost a sale.
If I know my program doesn't work then I need to tell my users how to bypass/fix the problem or fix it myself. I don't want to tell my prospective client that MS doesn't know what it is doing in regards to the UAC and please turn it off. What are they going to think about me
Glen Harvy
|
|
|
|
|
Ok well fortunately a program can request admin privileges - but I think it has to be restarted for that. It'll throw an UAC prompt of course but everyone always clicks OK anyway.
|
|
|
|
|
With Vista you sometimes have to right click on the application and select run as administrator. This will run the program as the administrator without have to always to UAC off.
Hope that helps.
|
|
|
|
|
tech603 wrote: right click on the application and select run as administrator
I never knew that - thanks - it is another option I can suggest until I get this issue resolved.
Glen Harvy
|
|
|
|
|
I have been telling my users to switch the UAC of and of course this solves their immediate problem. However, that doesn't solve the issue - why can't my program read the data directory
After another couple of hours research it seems InstallAware isn't changing the permissions as I thought it was. This now seems to make everything fall into place for me.
I have found this http://stackoverflow.com/questions/243995/setting-folder-permissions-on-vista[^] and as I already have InstallAware (which is running with sufficient privileges) run an update program then I will include the method and make sure the said directory is granted read/write access.
Glen Harvy
|
|
|
|
|
|
If it's just during the program run rather than the application install, you need to add an Application Manifest File and edit it to request the permissions in there. The user will be greeted with the UAC prompt each time, but that's life with Vista
The recommendation is to make the program not require elevation, but as you know, that's not always possible/practical.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanks for your comments.
I have made some progress:
DaveyM69 wrote: you need to add an Application Manifest File
Actually, VS2008 adds it for you automatically and it defaults to 'asInvoker'. That's why my application runs OK when launched by the installer (by default the installer has elevated privileges) but not when the user (without elevated privileges) launches my application.
DaveyM69 wrote: The recommendation is to make the program not require elevation, but as you know, that's not always possible/practical.
My application pops up it's own messagebox saying it can't access it's database. I included this ages ago well before Vista. I have determined that with Vista, it is because the UAC prevents access to the Common Application Data folder. The name of that folder is to me incongruous and lead me away from the fact that it cannot be read or accessed unless you have sufficient privileges. It's 'common' to all users accessing my application but not 'common' to all user privileges.
Having discovered that fact, I later discovered that my Installer (InstallAware) fails to set privileges even if I do tell it to. Apparently you need to write additional scripts to get InstallAware to do it in Vista but InstallAware's help file and support generally lacks any specific information on how to do this.
Earlier in this thread, you will read how I have discovered some code which I have now included in a program that runs at install time and therefor inherits InstallAware's elevated privileges. This code apparently sets the permissions successfully.
Unfortunately I don't even own a copy of Vista so I can't personally test this. I am waiting for a tech savvy person I know who owns Vista to test it for me. If it works, I will post a small article because frankly, I don't see what all the fuss is about in regards to the UAC and Vista.
Glen Harvy
|
|
|
|
|
Here is what I'm trying:
System.Drawing.SolidBrush myPen = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
Graphics h = webBrowser1.CreateGraphics();
h.FillRectangle(myPen, new Rectangle(5, 5, 10, 10));
myPen.Dispose();
h.Dispose();
It doesn't draw anything onto it, I've tried drawing onto buttons and other things just to make sure I'm doing it right and it works in the other cases.
|
|
|
|
|
I would think you need to derive from WebBrowser and override the OnPaint method.
modified on Friday, March 20, 2009 8:33 PM
|
|
|
|
|
Just tried this and it didn't work. Sorry.
|
|
|
|
|
ya, I donno
google hasn't yielded any results either
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
wbHandle = webBrowser.Handle;
StringBuilder className = new StringBuilder(100);
while (className.ToString() != "Internet Explorer_Server") // The class control for the browser
{
wbHandle = GetWindow(wbHandle, 5); // Get a wbHandle to the child window
GetClassName(wbHandle, className, className.Capacity);
}
//Show Click
System.Drawing.Graphics g;
g = Graphics.FromHwnd(wbHandle);
g.DrawEllipse(new Pen(new SolidBrush(Color.Red),15), yourX, yourY, 15, 15);
//g.DrawImageDrawString("X", this.Font, new SolidBrush(Color.Red), yourX, yourY)
g.Dispose();
|
|
|
|
|
Hello,
Beyond monitoring registry, file system, etc access with process monitor, and window messages with the likes of something like Winspector, is there a piece of software that can watch API calls of processes?
Thanks,
Matt
|
|
|
|
|
I was tempted to say .. 'look at Detours' qv http://research.microsoft.com/en-us/projects/detours/[^], but that doesnt help you in a C# environment AND I think you'd still have to know what API calls you were going to watch ahead of time ..
so Im sorry, this is a waste of a post - I hope someone else has useful info for you ..
'g'
|
|
|
|
|
That's very interesting, and brings up the point that the senior dev at my work said... detour/redirect the APIs.
I think that process monitor actually attaches a debugger to each process, this isn't enough?
What about analyzing the call stack (like process explorer), but in an on going logging manner?
Thanks,
Matt
[ud]
eyyy yo[^]
modified on Friday, March 20, 2009 8:21 PM
|
|
|
|
|
bbranded wrote: What about analyzing the call stack (like process explorer), but in an on going logging manner?
ok, I could see this being used for exploratory purposes/during development, but, 'on going' ... surely it would be very expensive cpu-wise ?
Interesting issue though .. does tickle something in the reccesses of my deep/gutter like brain .. something about someone with an instrumentation API for C# - but it wasnt making him/them any money so I think it got canned .. lets see...
well, it wasnt this http://tracetool.sourceforge.net/[^] I was thinking of, but it may give you ideas ...
'g'
|
|
|
|
|
I don't mean "on going," like on going, but more like how you'd use process monitor. Process explorer's call stack thing is very small, and simple.
I'm looking to passively observe, and am looking for a piece of software, although an API is cool too. I'm not particularly looking for a debugger, as I can't debug software I may need to monitor (I work at a hedge fund, and am a net and sys admin, but I do code in C#).
Are you speaking of fastice, or whatever that debugger is?
Thanks for the replies!
Matt
|
|
|
|