|
How do you find out the MDAC version programmically. I don't wont to hard code a specific version into the provider when I open the DbConnection.
Thanks for your help!
Lets Go, Lets hit the tape!
|
|
|
|
|
Maybe you can do so by retrieving from the registry. Just a quick thought.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
That did it! Thanks programmers!
Lets Go, Lets hit the tape!
|
|
|
|
|
I need to find out how to make it so that my program is notified whenever the user's wallpaper is changed. How do I get Windows to tell me that? (I really don't like the idea of setting a timer to check the registry every few seconds)
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I developed a web application, which has two sections
Client Section: that is visible to local users
Control Panel: allows admin of the site to control the contents of the web application.
I created a cpanel folder on the root of the web application, and all the pages and functionality of Control Panel section goes there. The sample structure of the files is as in below section:
/Default.aspx 'Client Side File
/contactUs.aspx 'Client Side File
/Aboutus.aspx 'Client Side File
/Web.config 'Main Configuration file ( admin section uses connectionstring from
'the same web.config file
/AppCode/DAL/Classes.vb ' Contains all the classes used in both client and cpanel section
/CPanel/Default.aspx ' Admin side File
/Cpanel/UpdateContactus.aspx ' Admin Side File
/Cpanel/UpdateAboutus.aspx ' Admin Side File
Now problem is that, i need to Secure Pages in CPANEL by adding Authenticating process, now if i add the authentication information in
/Web.Config /Main configuration file
then it will apply on both client side and Cpanel side as well... but i need this authentication only in CPanel side, so what i did is add a new configuration file with appropriate instructions and a Login Page, where person trying to open CPanel will be redirected if he/she has not logged in using proper username and password.
here i added those files at place
/CPanel/Web.Config
/CPanel/Login.aspx
but when i try to open any page, it gives me an error message
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS
---- The code for Web.config -----
<forms loginurl="Login.aspx" name="realestate" path="/" protection="All" timeout="30">
Any Solution?
1- Can we merge two different projects with different web.config files with each others?
:- Rashid Ali -:
|
|
|
|
|
Hi Rashid,
U should try ASP.NET Configuration. I believe U will get your answer there.
Regard,
Edwin
|
|
|
|
|
I want to be able to write data, to a file in a particular place, and read it back from that location.
The code i have below will write the data to the file with no issues, but i cant figure out how to get it to read it back. Any help is appreciated,
Thanks
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
FileStream fs = new FileStream("test.dat",FileMode.OpenOrCreate,FileAccess.ReadWrite);<br />
BinaryWriter bw = new BinaryWriter(fs);<br />
BinaryReader br = new BinaryReader(fs);<br />
<br />
bw.Seek(10,SeekOrigin.Begin);<br />
bw.Write("hello World");<br />
<br />
bw.Seek(-10, SeekOrigin.End);<br />
<br />
string myString = br.ReadString();<br />
<br />
MessageBox.Show(myString); <br />
}<br />
|
|
|
|
|
Hi,
you have confused yourself I am afraid, I'll annotate your code with
the offset each reader/writer has:
FileStream fs = new FileStream("test.dat",FileMode.OpenOrCreate,FileAccess.ReadWrite);
BinaryWriter bw = new BinaryWriter(fs);
BinaryReader br = new BinaryReader(fs);
bw.Seek(10,SeekOrigin.Begin);
bw.Write("hello World");
bw.Seek(-10, SeekOrigin.End);
string myString = br.ReadString();
In summary: you can attach as many streams as you want to a single file.
Each stream will see the same data, but have its own pointer pointing into that data.
you skipped 10 bytes (in a new file, those bytes remain filled with zeroes),
then write a string, then move somewhat back.
The reading stream has not moved yet, so it reads at position 0, and finds a lot
of zeroes, which results in an empty string.
Normally you don't jump around like that. You either write (or read) sequentially,
or you move purposely around (say to skip records you are not interested in).
Hope this helps.
|
|
|
|
|
There is only one stream, bw and br share it.
|
|
|
|
|
Of course, my mistake.
So the only problem was the last seek.
I stand corrected.
|
|
|
|
|
Instead of bw.Seek(-10, SeekOrigin.End);
I tried
bw.Seek(10,SeekOrigin.Begin);
and
bw.Seek(("hello World".Length+1)*-1, SeekOrigin.Current);
both worked
|
|
|
|
|
Thankyou both for taking the time to reply =)
|
|
|
|
|
I've been working on a simple little Bible program and would like to get the Word displayed in a newspaper columns. Currently it's loading an entire chapter into a label control but I know that's not ideal.
I thought about placing multiple long label controls on the form but then I'd need a way to determine when to send the text to the next label or if the text goes off page or not. The reason I'm using a label right now is because I can set the background to an image of some old parchment paper.
Well, anyways, if anyone knows of a control out there that does this or a way to do it programmatically then I'd really appreciate it!!
Thanks!
|
|
|
|
|
First you have to get control of the journalist writing the column...
|
|
|
|
|
As I understand it you can get everything you want, and more, with a Panel.
In its Paint handler, you need to draw the background with Graphics.DrawImage(),
then the text with DrawString().
Graphics.DrawString() will wrap text for you if you give it a rectangle of the
intended width and sufficient height; there are about 30 overloads of that method,
so try to find the one that fits you most.
|
|
|
|
|
There is another way to do it as well provided you are willing to embrace .NET 3.0. With WPF there are a few controls which allows you to achieve what you want with great ease.
There is a hands on lab from Microsoft with a working sample to help you through. Try this link to download the hands on lab
http://wpf.netfx3.com/files/folders/labs/entry3343.aspx
Hope this helps
|
|
|
|
|
<br />
public String GiveTxtBxCellValue(GridView gv, Int32 RowNumber, Int32 CellNumber, Int32 ControlNumber)<br />
{<br />
return ((TextBox)gv.Rows[RowNumber].Cells[CellNumber].Controls[ControlNumber]).Text;<br />
}<br />
<br />
public String GiveLabelCellValue(GridView gv, Int32 RowNumber, Int32 CellNumber)<br />
{<br />
return gv.Rows[RowNumber].Cells[CellNummer].Text;<br />
}<br />
If the PK or FK field in the grid is editable it is placed in a Textbox field
In that case you use
String PrimaryKeyField = GiveTxtBxCellValue(YourGrid, YourGrid.EditIndex, PKCellnumber, 0);
mostly 0 control is the control you need.
Same for ForeignKeyField
If the PK and FK are NOn-editable in your GridView you use
String PrimaryKeyField = GiveLabelCellValue(YourGrid, YourGrid.EditIndex, PKCellnumber);
-- modified at 2:23 Friday 3rd August, 2007
|
|
|
|
|
Hi I am using class file to Add Or delete Or update data in my SQl Server DataBase. Now I want to write code under a button click event to show the next row data serially in my text boxes(or may be I can Define them).Now Can any one tell what is the method or command to veiw the next data or next row or previous?
|
|
|
|
|
There's no such method. You'll probably want to load data in a DataSet, maybe wrapped in a class that holds an index to the current DataSet.Tables[0].Rows[ndx] .
|
|
|
|
|
How can I define Tab order in my form? I mean suppose I have 4 textbox and 3 buttons in my form. AnD Now I want to make a Tab order. Can anyone tell me how?
|
|
|
|
|
Hello,
Just set the "TabIndex" Property of the Controls.
All the best,
Martin
|
|
|
|
|
Thank you Sir. And All the best to you too
|
|
|
|
|
You can use Visual Studio to do it graphically. With the form open (and selected), go to View - Tab Order, and then click on every control in the order you want.
|
|
|
|
|
Use the TabIndex property and make sure TabStop is set to true.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|