|
I don't know why it didn't hit me earlier. Maybe I've been working for too long and should take a break.
I'm just going to use the Arobat Reader ActiveX control
Still would be nice if you could update MIME type
|
|
|
|
|
You can use <meta http-equiv="Content-Type" content="application/vnd.adobe.xfdf"> as the first META tag (to be safe). If doing this from ASP.NET, you'd simply set this MIME type in the HttpResponse.ContentType property before writing to the response stream itself.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks Heath. I understand that part clearly. However, the WebBrowser is not navigating, therefore it is not reading any response stream. The way I was trying to do (navigate to about:blank and set the htmldoc) it just doesn't work.
I just switched to using the PDF ax ctrl. Besides its silly to have the PDF control hosted inside a webbrowser control when you don't need to navigate to anything. Just setting the src of the pdf control would work fine. (Originally I wanted to make the data more secure by not writing it to disk. I found another workaround for that)
|
|
|
|
|
Does anyone know how to drag/drop files from a C# application into Windows Explorer?
I've been trying to find an example on the web for hours - no luck
Elena
|
|
|
|
|
DataObject data=new DataObject();
data.SetData(DataFormats.FileDrop,new string[]{filename});
control.DoDragDrop(data,DragDropEffects.All);
|
|
|
|
|
Thak you!!! It works! I can finally go home
Elena
|
|
|
|
|
I need a small pdf component that does nothing more than fill a feild.
I've found nice components but the prices are through the roof. PDFKit has the functionality I need, however the pricing is just outrageous. I don't mind if the price < 100
|
|
|
|
|
Has anyone heard of Adobe XML/PDF format? XDP and XFDF. This stuff is awesome.
Take a look at these links :
http://www.adobe.com/enterprise/xml.html
http://www.planetpdf.com/planetpdf/pdfs/pdf2k/03w/defurio_pdfxmlforms1103.pdf
http://www.adobe.com/enterprise/pdfs/xml_whitepaper.pdf
This is going to be the best solution to my problem if I figure out how it works. Stilling looking for that PDF component.
|
|
|
|
|
We ended up using a 3rd party library on something we were working on. I don't remember this XML stuff being available back then. I only remember finding the Adobe SDK, which is very low level (roll your own layout basically).
This seems to have all the functionality we needed. Let me know how it goes for you.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
I ended up using the XML FDF. When the webbrowser picks up the type "application/vnd.adobe.xfdf" it loads Acrobat Reader. The XFDF file is a simple xml file that contains the feild information. Acrobat Reader figures out what pdf this applied to by looking at the <f href="___.pdf"> tag. This is great !!
|
|
|
|
|
That like it might work for what we used the third party tool for.
We basically have an online "application" (as in apply for service) that currently uses several ASP pages to stuff things into a database. The final step creates a PDF document by querying the database and filling in form fields from the queries. Creating XML from the database and filling it by hand would work just as well and would have saved us from buying a 3rd party library.
Do you happen to know if there is any way to protect/encrypt the XFDF so that it can't be edited in Acrobat (granted, the encryption's been broken before, but it's a little safer this way)?
I'll have to check this out for our next version.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
I am sure I am just not looking in the right place.
Can someone please point me in the direction of a good tutorial on using mock objects? I know what they are and why I need them, I just now need to know how to use them.
I am reading articles on unit testing here at CodeProject and Peter Provost's article touches on using mock objects, but the version of DotNetMock available for download as featured in the tutorial is different from what is in his article.
Marc Clifton mentions mock objects, but doesn't get into the guts of how to use them.
Where should I go from here?
Thanks,
- Craig
|
|
|
|
|
Just out of curiosity, I googled Peter Provost. The top of the list pointed to a log discussion where he stated he kept getting error no matter how he tried implementing DotNetMock and is relooking at the unit test issue.
I'm not sure what you are trying to do but building standalone test harnesses and running them against your objects prior to integration is pretty much standard fair. The typical approach we take is write a simple WinForm app with a 'Test It' button. It would then instantiate the object, pass data to it (usually what I provided as input to it), and displayed returned data (if applicable). It would be left without any exception catching so that if my object blew out of the water, I'd clearly see what I did to screw things up. If the harness is incorporated into the solution as an independant project, then I could also single step testing.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hello, i made this click event for a form, which stores and then divides a name in 3 seperate vars i.e. John C Sharp, to "John", "C", "Sharp".
here's the code:
private void btnParse_Click(object sender, System.EventArgs e)<br />
{<br />
string strFullName;<br />
string strFirstName;<br />
string strInitial;<br />
string strLastName;<br />
int intLocation1;<br />
int intLocation2;<br />
int intLength;<br />
<br />
strFullName = txtName.Text;<br />
<br />
intLength = strFullName.Length;<br />
intLocation1 = strFullName.IndexOf(" ");<br />
intLocation2 = strFullName.IndexOf(" ", intLocation1 + 1);<br />
<br />
strFirstName = strFullName.Substring(0,intLocation1);<br />
strInitial = strFullName.Substring(intLocation1 + 1);<br />
strLastName = strFullName.Substring(intLocation2 + 1);<br />
<br />
lblFirstName.Text = strFirstName;<br />
lblInitial.Text = strInitial;<br />
lblLastName.Text = strLastName;<br />
}
and when i enter no text or when i tried to trigger the text change event of the TextBox i got this error (it works just fine when i enter a full name)
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll<br />
<br />
Additional information: Length cannot be less than zero.
Thanks in advance (plz try to keep this simple as i am quite new to C#, thanks in advance )
|
|
|
|
|
intLocation1 = strFullName.IndexOf(" ");
In an empty strFullName the " " isn't found, so intLocation1 is -1.
strFirstName = strFullName.Substring(0,intLocation1);
For an empty strFullName this means Substring(0, -1) . What is a String with a negative length?
You should catch empty and short names:
<br />
String[] nameParts = strFullName.Split(' ');<br />
if(nameParts.Length == 3){<br />
strFirstName = nameParts[0];<br />
strInitial = nameParts[1];<br />
strLastName = nameParts[2];<br />
else if(nameParts.Length == 2){<br />
strFirstName = nameParts[0];<br />
strLastName = nameParts[1]; <br />
}else{<br />
MessageBox.Show("Please enter a full name.");<br />
}<br />
|
|
|
|
|
Heh, got it mate. Thanks for taking the time to help me understand this one John. Although i am not that used working with arrays it seems to be much "smoother" than my declaration
|
|
|
|
|
Need some help :
When I tried to read Identity column with ADO.NET DataReader, I'm getting the following error::=>
"The data value could not be converted for reasons other than sign mismatch or data overflow.For example, the data was corrupted in the data store but the row was still retrievable."..
The Code which I wrote is described below:
oDR is data reader
while(oDR.Read())
{ListItem oItem = new ListItem(oDR.GetString(2),oDR.GetInt32(0).ToString());
wsdrpdwnlst1.Items.Add(oItem);} //wsdrpdwnlst1 is a list box
Note : (where oDR.GetInt32(0) supposed to give me the identity column.) but I am getting the above error. I need the help at the earliest if possible.
|
|
|
|
|
The error is definitely pointing at your oDR.GetInt32(0).ToString() portion of your code. You don't show what the SQL select statement looks like. But it sounds like the data you are getting is either not Int32 (and thus cannot convert it) or IS CORRUPT.
The first thing to do is find out just what the problem is with the data. Put a breakpoint at the while statement, step into the read, then do a QuickWatch on the oDR object to see what your second parameter data actually is. It could be something as simple as the fact that the data IS numeric, but your database is returning leading SPACES instead of leading ZERO.
If the data looks like crap, then the next thing to do is take the SQL that you are using in your program and run it inside Query Analyzer if is SQL or the equivalent if it is Oracle. See what you get back with the raw SQL and make sure your SELECT statement is truly executing the way you think it is.
All Debug 101 tasks.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Heyas,
I am writing on a component which uses the ProvideProperty Attribute to add new properties to other existing components. And it works fine. But, the new property doesn't have any description etc., in other words no Description, Editor etc. Attribute to make it fine. I am searching for hours now but didn't find any way to add Attributes to ProvideProperty-added properties .
Does anyone have experience in this?
Thanks,
'Mike
--------------------------
xplo.re Project Management
http://www.xplo-re.com/
|
|
|
|
|
Maybe you are looking too hard. Take a look at this :
http://www.codeproject.com/dotnet/iextenderprovider.asp
All you have to do is this :
[Description("Description")]
[Category("Appearance")]
public string GetMyString(Panel p)
{
return EnsurePropertiesExists(p).MyString;
}
You set the description attribute not in the class, but on the actual GetXXXX function.
|
|
|
|
|
Ah, thanks very much!
This works. I already tried same as in the given code, but using the SetXXX method... well wrong choice >.<
Now it works perfect
--------------------------
xplo.re Project Management
http://www.xplo-re.com/
|
|
|
|
|
Hi guys,
I've been searching for this for 4 hours, but it just doens't seem to work.
I have an access database, and i have to add a column to it.
Here's my code:
string connString = "Provider=Microsoft.Jet.OLEDB.4.0;" +<br />
@"Data Source=D:\My Documents\Visual Studio 2003.NET\VerboServe\Verboserve.mdb;" +<br />
"User ID=Admin;" +<br />
"Password=";<br />
OleDbConnection conn = new OleDbConnection(connString);<br />
DataSet ds = new DataSet();<br />
<br />
conn.Open();<br />
<br />
OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT * FROM Verbs", conn);<br />
OleDbCommandBuilder commandBuilder = new OleDbCommandBuilder(dataAdapter);<br />
<br />
dataAdapter.Fill(ds, "Verbs");<br />
<br />
ds.Tables["Verbs"].Columns.Add("Wouter");<br />
<br />
foreach (DataRow thisRow in ds.Tables["Verbs"].Rows)<br />
{<br />
thisRow["Wouter"] = "True";<br />
}<br />
<br />
commandBuilder.QuotePrefix = "[";<br />
commandBuilder.QuoteSuffix = "]";<br />
<br />
ds.AcceptChanges();<br />
dataAdapter.Update(ds, "Verbs");
Can anyone tell me how to do this?
Thanks,
Wouter
|
|
|
|
|
ds.AcceptChanges is marking all rows as normal. DataAdapter.Update searches for changed rows and updates them, then internally calls AcceptChanges . Since you're doing this yourself BEFORE calling Update , the Update method is NOT seeing any changes.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thankx for the info, but i am adding columns here, or is that the same?
|
|
|
|
|
You can't do it that way. You either have to issue an ALTER TABLE command or use a product-specific library to modify the database structure, like DDL for Access or SQL-DMO or SQL Server. This has been addressed many times before here. I suggest you click Search Comments and see some of the replies for more details and other ideas. While searching comments, you should probably also include the ADO.NET forum, too.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|