|
Then I have no further suggestions.
But if you post the problem code, someone else may be able to help.
Only post the relevant code, and please surround it with PRE tags, as that keeps the formatting and colourization making it much easier for people to read.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks alot for your time
|
|
|
|
|
Check your connection string. I guess the path to the MDB file must have changed.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
It sounds like you have a broken reference.
In a code window (CTRL+G to bring up the debug window is the easiest way to get to one), go to tools references.
One of the checked items in the list might say broken, if so thats your problem.
If none say broken, then take a screenshot and save it.
Untick all the items that access allows (some it wont allow you to), close the reference dialog and reopen it.
Then find all the items you unticked (the list is sorted alphabetically) and tick them.
Close the dialog and try again!
If you have a missing reference, and can't find it in the list, you'll need to determin where it came from and install it on the desktop.
|
|
|
|
|
Hi,
I am a novice in c# but i have been tinkering windows for long time. What are the libraries which could manipulate pdf files. My requirement is i want to extract images from pdf also i want create image of individual pdf pages... the first one is the most needed... if i could get links or references or explanations that could be nice... meanwhile i will explore codeproject to see some articles related to my requirement...
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
As far as libraries go Google for c# pdf libraries and take your pick. There are lots of established ones like PDFSharp, ITextSharp etc. but that search listed several that I have no experience of.
Images of a PDF page? Same thing applies, Google for c# image of pdf page, and it's "eany meany miney mo". The first on the list I got was Generate Thumbnail Images from PDF Documents[^], which although it is VB and gives thumbnails, should suggest a few things. If you don't like that one, pick another, there are loads of hits after all.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I have two dictionaries that I output to two separate DataGridViews. I need to be able to alternate the output of the two dictionaries to one DataGridView. Any help would be appreciated.
|
|
|
|
|
Then just do so by writing some code.
The two dictionaries better have the same number of entries, otherwise you'd have to come up with a more precise specification.
BTW: Right now I can't imagine an application domain where your requirement makes sense.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I am differencing two files. Each file's specs are put into a dictionary and then output the two files into two separate DataGridViews. Then differences are colored. I am required to show these in a single DataGridView where one line of the gridview is outputted from one dictionary and then the other dictionary is outputted as they alternate. The dictionaries can have different amout of entries as one file may have more or less records than the other.
|
|
|
|
|
I was just trying to give file premission to my dummy files but encountered a problem. I found out that only the last applied permission is imposed on the file while rest are overriden or not applied.
using System;
using System.IO;
public class RegistryEditor
{
public static void Main()
{
try
{
FileInfo f = new FileInfo(@"C:\Test.txt");
f.Attributes = FileAttributes.System;
FileInfo f1 = new FileInfo(@"C:\Test.txt");
f1.Attributes = FileAttributes.ReadOnly;
FileInfo f2 = new FileInfo(@"C:\Test.txt");
f2.Attributes = FileAttributes.Hidden;
FileInfo i = new FileInfo(@"C:\Test1.txt");
i.Attributes = FileAttributes.System;
i.Attributes = FileAttributes.Hidden;
i.Attributes = FileAttributes.ReadOnly;
}
catch (Exception ex)
{
Console.Write(ex.ToString());
}
}
}
Banking establishments are more dangerous then standing armies.
|
|
|
|
|
Hi,
int i;
i=1;
i=2;
i=4;
Now what is the final value of i? Is it 7? Why would it be any different with file attributes?
File attributes are flags, i.e. they have a binary pattern with one bit set, all others cleared. So you can OR them together (with the '|' operator) to get combinations of them.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
You are going to kick yourself! You are, you are...
Ishaan Karnik wrote:
FileInfo f = new FileInfo(@"C:\Test.txt");
f.Attributes = FileAttributes.System;
Assume it works: the attributes for the file are now "System"
Ishaan Karnik wrote:
FileInfo f1 = new FileInfo(@"C:\Test.txt");
f1.Attributes = FileAttributes.ReadOnly;
Assume it works: the attributes for the file are now "ReadOnly"
Had you considered?
FileInfo f1 = new FileInfo(@"C:\Test.txt");
f1.Attributes += FileAttributes.ReadOnly;
What are the attributes now?
I told you, you would kick yourself!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Except that if it already was ReadOnly, it will be Hidden and not ReadOnly anymore. (ReadOnly = 1, Hidden = 2)
|
|
|
|
|
Yes you are right, I'll start kicking myself when I stop typing: it should be "|=" not "+="
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff,
Yes, i had considered
FileInfo i = new FileInfo(@"C:\Test.txt");<br />
i.Attributes += FileAttributes.ReadOnly;<br />
But this gives an error Operator ' += ' cannot be applied to operands of type 'System.IO.FileAttributes' and 'System.IO.FileAttributes'.
Luc Pattyn,
ThankYou. Your suggestion worked.
|
|
|
|
|
you're welcome.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi
i'm looking for a calendar control like outlook 2007.
can anybody help me ?
thanks
|
|
|
|
|
If you had, at the very least, searched the CP articles, you might have found MS Outlook style Calendar[^].
You didn't search, so you didn't find. Think yourself lucky that I'm in a good mood today, for a change!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello, you can try this one:
<input onclick="showcalendar(event, this)" onfocus="showcalendar(event, this)" size=24 name=birthday>
JS code:
var userAgent = navigator.userAgent.toLowerCase();
var is_webtv = userAgent.indexOf('webtv') != -1;
var is_saf = userAgent.indexOf('applewebkit') != -1 || navigator.vendor == 'Apple Computer, Inc.';
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko' && !is_saf) && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera && !is_saf && !is_webtv) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
var controlid = null;
var currdate = null;
var startdate = null;
var enddate = null;
var yy = null;
var mm = null;
var currday = null;
var addtime = false;
var today = new Date();
var lastcheckedyear = false;
var lastcheckedmonth = false;
function $(id) {
return document.getElementById(id);
}
function doane(event) {
e = event ? event : window.event ;
if(is_ie) {
e.returnValue = false;
e.cancelBubble = true;
} else {
e.stopPropagation();
e.preventDefault();
}
}
function loadcalendar() {
s = '<style type="text/css">';
s += '.calendar_header {text-align: center;BORDER: #698CC3 1px solid; BACKGROUND: white; outline: 1px solid #698CC3}';
s += '.calendar_checked A { COLOR: #FFF; background:#698CC3;}';
s += '.calendar_expire A:link { COLOR: #999;}';
s += '.calendar_default A:link { COLOR: #000;}';
s += '.calendar_today A:link { display: inline-block;COLOR: #9EB6D8; border:1px solid #698CC3; padding:1px;}';
s += '.calendar_expire A:hover,.calendar_today A:hover,.calendar_default A:hover { COLOR: #FFF; background:#9EB6D8;}';
s += '#calendar_year,#calendar_month { Z-INDEX: 10; DISPLAY: none; POSITION: absolute;}';
s += '</style>';
s += '<div id="calendar" style="display:none; position:absolute; z-index:9;" onclick="doane(event)">';
s += '<div style="width: 180px;"><table cellspacing="0" cellpadding="0" width="100%" style="text-align: center;BORDER: #698CC3 1px solid; BACKGROUND: white; outline: 1px solid #698CC3">';
s += '<tr align="center" bgcolor="#E3EFFF"><td height=20><a onclick="refreshcalendar(yy, mm-1)" title="上一月"><<</a></td>';
s += '<td colspan="5" style="text-align: center"><a onclick="showdiv(\'year\');doane(event)" title="点击选择年份"><span id="year"></span>年</a> ';
s += '<a onclick="showdiv(\'month\');doane(event)" title="点击选择月份"><span id="month"></span>月</a></td><td><A onclick="refreshcalendar(yy, mm+1)" title="下一月">>></A></td></tr>';
s += '<tr><td height=20>日</td><td>一</td><td>二</td>& lt;td>三</td><td>四</td><td>五< /td><td>六</td></tr>';
s += '<tr><td colspan="7" height="1"><hr width="100%" size="1" /></td></tr>';
for(var i = 0; i < 6; i++) {
s += '<tr>';
for(var j = 1; j <= 7; j++)
s += '<td id=d' + (i * 7 + j) + ' height="19"></td>';
s += "</tr>";
}
s += '</table></div></div>';
s += '<div id="calendar_year" onclick="doane(event)">';
s += '<select id=calendar_year_select size=10 onchange="refreshcalendar(this.options[this.selectedIndex].value,mm);$(\'calendar_year\').style.display=\'none\';">'
for(var k = today.getFullYear()-100; k <= today.getFullYear()+100; k++) {
s += '<option value='+ k +'>'+ k +'</option>';
}
s += '</select>';
s += '</div>';
s += '<div id="calendar_month" onclick="doane(event)" style="height:210px;OVERFLOW:auto;padding-left:5px">';
s += '<select id=calendar_month_select size=10 onchange="refreshcalendar(yy,this.options[this.selectedIndex].value-1);$(\'calendar_month\').style.display=\'none\';">'
for(var k = 1; k <= 12; k++) {
s += '<option value=' + (k<10? '0' : '') + k +'>' + (k<10? '0' : '') + k +'</option>';
}
s += '</select>';
s += '</div>';
if(is_ie && is_ie < 7) {
s += '<iframe id="calendariframe" frameborder="0" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"></iframe>';
s += '<iframe id="calendariframe_year" frameborder="0" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"></iframe>';
s += '<iframe id="calendariframe_month" frameborder="0" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"></iframe>';
}
document.write(s);
document.onclick = function(event) {
$('calendar').style.display = 'none';
$('calendar_year').style.display = 'none';
$('calendar_month').style.display = 'none';
if(is_ie && is_ie < 7) {
$('calendariframe').style.display = 'none';
$('calendariframe_year').style.display = 'none';
$('calendariframe_month').style.display = 'none';
}
}
$('calendar').onclick = function(event) {
doane(event);
$('calendar_year').style.display = 'none';
$('calendar_month').style.display = 'none';
if(is_ie && is_ie < 7) {
$('calendariframe_year').style.display = 'none';
$('calendariframe_month').style.display = 'none';
}
}
}
function parsedate(s) {
/(\d+)\-(\d+)\-(\d+)\s*/.exec(s);
var m1 = (RegExp.$1 && RegExp.$1 > today.getFullYear()-120 && RegExp.$1 < today.getFullYear()) ? parseFloat(RegExp.$1) : today.getFullYear();
var m2 = (RegExp.$2 && (RegExp.$2 > 0 && RegExp.$2 < 13)) ? parseFloat(RegExp.$2) : today.getMonth() + 1;
var m3 = (RegExp.$3 && (RegExp.$3 > 0 && RegExp.$3 < 32)) ? parseFloat(RegExp.$3) : today.getDate();
/(\d+)\-(\d+)\-(\d+)\s*(\d*):?(\d*)/.exec("0000-00-00");
return new Date(m1, m2 - 1, m3);
}
function settime(d) {
yy = yy;
mm = mm;
$('calendar').style.display = 'none';
$('calendar_month').style.display = 'none';
if(is_ie && is_ie < 7) {
$('calendariframe').style.display = 'none';
}
controlid.value = yy + "-" + zerofill(mm + 1) + "-" + zerofill(d);
}
function showcalendar(event, controlid1, addtime1, startdate1, enddate1) {
controlid = controlid1;
addtime = addtime1;
startdate = startdate1 ? parsedate(startdate1) : false;
enddate = enddate1 ? parsedate(enddate1) : false;
currday = controlid.value ? parsedate(controlid.value) : today;
yy = currday.getFullYear();
mm = currday.getMonth();
$('calendar').style.display = 'block';
$('calendar').style.left = ie_x(controlid)+'px';
$('calendar').style.top = (ie_y(controlid) + 16)+'px';
doane(event);
refreshcalendar(currday.getFullYear(), currday.getMonth());
lastcheckedyear = currday.getFullYear();
lastcheckedmonth = currday.getMonth() + 1;
if(is_ie && is_ie < 7) {
$('calendariframe').style.top = $('calendar').style.top;
$('calendariframe').style.left = $('calendar').style.left;
$('calendariframe').style.width = $('calendar').offsetWidth;
$('calendariframe').style.height = $('calendar').offsetHeight;
$('calendariframe').style.display = 'block';
}
}
function refreshcalendar(y, m) {
var x = new Date(y, m, 1);
var mv = x.getDay();
var d = x.getDate();
var dd = null;
yy = x.getFullYear();
mm = x.getMonth();
$("year").innerHTML = yy;
$("month").innerHTML = mm + 1 > 9 ? (mm + 1) : '0' + (mm + 1);
$("calendar_year_select").value = yy;
$("calendar_month_select").value= mm + 1 > 9 ? (mm + 1) : '0' + (mm + 1);
for(var i = 1; i <= mv; i++) {
dd = $("d" + i);
dd.innerHTML = " ";
dd.className = "";
}
while(x.getMonth() == mm) {
dd = $("d" + (d + mv));
dd.innerHTML = '<a href="#" onclick="settime(' + d + ');return false">' + d + '</a>';
if(x.getTime() < today.getTime() || (enddate && x.getTime() > enddate.getTime()) || (startdate && x.getTime() < startdate.getTime())) {
dd.className = 'calendar_expire';
} else {
dd.className = 'calendar_default';
}
if(x.getFullYear() == today.getFullYear() && x.getMonth() == today.getMonth() && x.getDate() == today.getDate()) {
dd.className = 'calendar_today';
dd.firstChild.title = '今天';
}
if(x.getFullYear() == currday.getFullYear() && x.getMonth() == currday.getMonth() && x.getDate() == currday.getDate()) {
dd.className = 'calendar_checked';
}
x.setDate(++d);
}
while(d + mv <= 42) {
dd = $("d" + (d + mv));
dd.innerHTML = " ";
d++;
}
}
function showdiv(id) {
$('calendar_' + id).style.left = ie_x($(id))+'px';
$('calendar_' + id).style.top = (ie_y($(id)) + 16)+'px';
$('calendar_' + id).style.display = 'block';
if(is_ie && is_ie < 7) {
$('calendariframe_' + id).style.top = $('calendar_' + id).style.top;
$('calendariframe_' + id).style.left = $('calendar_' + id).style.left;
$('calendariframe_' + id).style.width = $('calendar_' + id).offsetWidth;
$('calendariframe_' + id ).style.height = $('calendar_' + id).offsetHeight;
$('calendariframe_' + id).style.display = 'block';
}
}
function zerofill(s) {
var s = parseFloat(s.toString().replace(/(^[\s0]+)|(\s+$)/g, ''));
s = isNaN(s) ? 0 : s;
return (s < 10 ? '0' : '') + s.toString();
}
loadcalendar();
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 22:02pm.
|
|
|
|
|
I am trying a program to add keys, however i am getting an exception saying
System.UnauthorizedAccessException : Cannot write to registry key
You can consider me beginner in registry editing issue.
using System;
using System.Security.Permissions ;
using Microsoft.Win32;
public class RegistryEditor
{
public static void Main()
{
try
{
RegistryKey hkcu = Registry.CurrentUser;
RegistryKey hkSoftware = hkcu.OpenSubKey("Software");
RegistryKey hkMicrosoft = hkSoftware.OpenSubKey("Microsoft");
RegistryKey hkIshaan = hkSoftware.CreateSubKey("Test1");
hkIshaan.SetValue("Name", "Ishaan");
hkIshaan.SetValue("Age", "20");
hkIshaan.Close();
hkSoftware.Close();
hkcu.Close();
}
catch (Exception ex)
{
Console.Write(ex.ToString());
}
}
}
Banking establishment are more dangerous then standing armies.
|
|
|
|
|
Two things:
1) You can concatenate your two OpenSubKey calls:
RegistryKey hkMicrosoft = hkcu.OpenSubKey(@"Software\Microsoft");
2) The OpenSubkey has 4 overloads. If you look it up on MSDN the last one allows you to specify the RegistryKeyPermissionCheck (what you can do with subkeys), and RegistryRights (read only, read/write TakeOwnership etc.).
I am still on XP, so I don't know how this applies under Vista and Weven, which I know are a bit more picky about these sorts of things.
Hope that this is of some help!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank You . I am also using XP. Is my rest of the code right?
|
|
|
|
|
The only thing that I would say is, don't use the Microsoft subkey for writing to. Create your own subkey under Software for messing about with IshaanTesting or something like that.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi everyOne.
I have dataGridView in my project whitch is Bind to my dataBase
(Student's Table).After 3 months that the user has Saved around 3,000 rows in that table Now when they open that form with 3,000 Rows in Student's table it takes along time to load the form(Form become white).
What should i do to run that form without any problem and Quickly?
Thank u.
CanI
|
|
|
|
|
You need to filter what is retrieved and or displayed.
To filter what is retrieved, put a WHERE clause in the SELECT statement, to limit it to students whose name begins with 'A', for example. then allow the users to hit a 'Next' or 'Previous' button to move from the 'A's to the 'B's and vice versa. Or by their Major, or whatever.
To Filter what is displayed, the BindingSource has a Filter property that you can use to get a similar effect.
Hope this helps!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|