|
Hi
When I type turkish letters(Ğİö..) in a text box and try to pull data, it returns no row..
But when I type select command to SQL Enterprise manager and try to pull same data, it works...
My SQL command is "select * from myTable where (column1='Ğİ' COLLATE Turkish_CI_AI)
I make,
System.Threading.Thread.CurrentThread.CurrentCulture= new System.Globalization.CultureInfo("tr-TR");
in program init...
I put Language setting to form and Localizable=true
This problem only occurs on windows 2000 english, I have no problem with windows XP turkish
I hope I could explain my problem...
Thanks
|
|
|
|
|
i want to create a setup and deployemt project which creates three empty folder. and then i need the path or i say i want to access this path from my windows services. how can i do this???
|
|
|
|
|
To establish a connection from an aspx page to a word document stored in D drive.Then replace few words in document by words present in textboxes in aspx pages
Sowmya
|
|
|
|
|
Required for what? Homework assignment?
What is the point of your post? Have you encountered any problems writing this code? Do you have any specific questions?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
u shud use word interop and word application object.
|
|
|
|
|
I am new to codeproject, and relatively new to C#. Eventually i got bored of... non-saving uses... and decided i needed to save something. So i tried.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace FileMaker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCreate_Click(object sender, EventArgs e)
{
Stream myStream;
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if ((myStream = saveFileDialog1.OpenFile()) != null)
{
StreamWriter wText = new StreamWriter(myStream);
wText.Write("CHEESE");
myStream.Close();
}
}
}
}
}
It doesn't work. When i run the program and click on the button, and go through the save file dialog, a file does appear, but "CHEESE" does not appear in the text file. I cannot figure out why this doesn't work. So how do i fix this so that "CHEESE" appears in the file?
Thanks to anybody who helps!
|
|
|
|
|
try closing the streamwriter before closing the stream...
Luc Pattyn
|
|
|
|
|
wText.Close();
MyStream.Close();
unless u close the writer, buffered things will not be explicitly fwded to the disk.
|
|
|
|
|
Hello,
I have created a list of items within a combo box control and would like to use the word "Other" at the bottom of the list to enable a textbox control. Currently I can get the textbox to enable by selecting any list item in the combo box, but unfortunately the textbox enables regardless of what item I choose. I just want the item "Other" to enable it and nothing else.
I can't seem to find anything within MSDN or the net that explains how to do this, and i've seen many applications that use "Other" to enbable a textbox so I know that it can be done.
can someone help?
Thanks!!
|
|
|
|
|
use a Combobox.SelectedIndexChanged event handler that contains
myTextBox.Enabled=myComboBox.SelectedIndex==otherIndex;
Luc Pattyn
|
|
|
|
|
Hi,
Not exist a special function or property. You have to do it manually adding the item "Other" to the list of items and asign it a special value. Then, in the "SelectedIndexChanged" event of the combo box check if the new selected index is the same that the "Other"...
|
|
|
|
|
Hi,
I haven't found an easy way out of a problem I have. I have a class which I would like to initialize from different sources - such as a DataRow, an IDataReader etc. Something similar to:
class MyClass<br />
{<br />
public void Load( DataRow row )<br />
{<br />
m_strName = row["Name"];<br />
m_strTitle = row["Title"];<br />
}<br />
<br />
public void Load( IDataReader reader )<br />
{<br />
m_strName = row["Name"];<br />
m_strTitle = row["Title"];<br />
}<br />
}
You will notice that the code inside these functions is identical. However, I haven't found a way to refactor this code into one common function, since both snippets rely on the indexing feature supported both by DataRow and IDataReader, but I cannot figure out if this could be refactored into a common function (DataRow and IDataReader have no common base classes or interfaces, except System.Object of course).
Has anyone a solution to this? I really hate duplicating code!
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
You might try something like this code; Note that this is code that I haven't tested at all though:
public void Load (DataRow row )
{
Load((object)row);
}
private void Load(Object x)
{
m_strName = DataBinder.GetPropertyValue(x, "Name", null);
m_strTitle = DataBinder.GetPropertyValue(x, "Title", null);
}
|
|
|
|
|
Hi,
I can de/serialize objects of a class called Bookings.cs
Had a System.Drawing.Rectangle obj with an [XmlIgnore] in this class
and it ignored it
Later on I decided not to have rectangles displayed in
my windows form because I had to set event handling to them.
So I thought that I could use a flatted Button instead that resembles
a rectangle but also has event methods.
But I wanted a custom control so I extended the Button class.
These MyButton objects are created dynamically and I also declared this MyButton
obj with the [XmlIgnore], just replacing the System.Drawing.Rectangle obj with
MyButton myBut and instantiated it in the constructor of Booking.cs
During run-time i get a reflection error trying to create the XmlSerializer object with typeof(Booking[]) ??
Have googled it all day but cannot seem to understand the problem?
Is it because it is a inherited class this error shows up?
Seeking knowledge, Daniel...
|
|
|
|
|
I am trying to query an AD residing on a different server and came across a snippet. The following line caught my attention:
DirectoryEntry objEntry = new DirectoryEntry("LDAP://DCName/OU=testOU,DC=x,DC=y,DC=z,DC=COM","username","password",AuthenticationTypes.Secure);
Is there a way around hard coding the "username" and "password"? The last three parameters, are they even necessary for creating the DirectoryEntry instance?
Thanks
|
|
|
|
|
The only thing that is 'required' is the server path. The others would be optional parameters as far as I know. This is how I'm querying our AD server (keep in mind however if you're trying to modify anything in the entry, then it will require proper permissions to do so). I needed to query AD based on the samAccountName of a user. I am in NO way an expert, but this worked for me:
string uName;
uName = Environment.UserName;
DirectoryEntry entry = new DirectoryEntry("LDAP://SERVERNAME.SOMEPLACE.COM");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.Filter = ("(samAccountName= " + uName + ")");
Hope that helps for you. Best of luck.
Chris Potter
|
|
|
|
|
Thanks a lot for your response Chris, but suppose you are running your application using localhost while the AD hierarchy is set up in a remote machine in the network under a different domain, in that case would the additional parameters help? My querying AD using .NET concepts are a bit flaky and would really like to understand more.
Thanks...
|
|
|
|
|
Hmm... Well, ours is all on one domain. I wouldn't think it would require much different because of the domain controller communication. As long as it was an authenticated client on the domain (duh.. ..), I would think that it wouldn't matter which domain it was trying to communicate with. I myself am a bit flaky also, and as I said, it worked for us. You might try a little google grease with the extra knowledge you've presented to me, such as "DirectoryEntry use across domains" or something. I wish I could help more (and wish I knew more myself) so I could be of better help. Best of luck.
-Chris Potter
|
|
|
|
|
what kind of small projects that take priority in companies
in C# or ASP.NET
to show it in job interview
|
|
|
|
|
kifahhk wrote: what kind of small projects that take priority in companies
in C# or ASP.NET
to show it in job interview
CK-37.872
led mike
|
|
|
|
|
kifahhk wrote: what kind of small projects that take priority in companies in C# or ASP.NET
The kind of project that gets the business moving forward. Projects are not prioritised highly unless the business needs it (or rather the business "thinks" it needs it). In my experience companies often mis-prioritise projects then wonder what the brown stuff that's just got sprayed all over the walls is when the s**t hit the fan. (But you probably don't want to say that in an interview)
|
|
|
|
|
Hi, can anybody write steps to build an undo and redo functionality in C#. I checked couple of articles but they are all confusing.
I have a panel class that holds different items on panel. I want to store each panel in an arraylist/stack. So if user click on undo then just display that panel
Thanks
|
|
|
|
|
You basically have to implement the Memento design pattern.
Here is a helpful article:
http://www.codeproject.com/csharp/undoredobuffer.asp
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I wanted to bind a collect to a DataGridView, but the objects in the collection are collections themselves. Ideally, I'd like the objects in the later collection to be displayed as rows in the table and I thought I might be able to do that using the ITypedList interface and a custom PropertyDescriptor class. I came up with something like this for my GetItemProperties implementation:
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
{
PropertyDescriptor[] properties = new PropertyDescriptor[myCollection.Count];
for (int i = 0; i < myCollection.Count; i++)
{
properties[i] = new MyPropertyDescriptor(i.ToString(), i);
}
return new PropertyDescriptorCollection(properties);
}
MyPropertyDescriptor uses the index in the collection as a name for the property and also stores the index so I can recall the value.
Now to add a column to the collection in the DataGridView I do this:
design.Channels[0].Add(0);
DataGridViewTextBoxColumn dgvtbc = new DataGridViewTextBoxColumn();
dgvtbc.DataPropertyName = "0";
dgvtbc.HeaderText = "0";
dgvtbc.Name = "0";
dgvLevels.Columns.Add(dgvtbc);
This adds the column, but it doesn't appear to actually be bound to the data source because if I can the value in column 0, the corresponding item in the collection isn't changing. Does anybody have any idea if this can be made to work? Am I barking up the wrong tree?
Thanks
|
|
|
|
|
Hello,
I have an HtmlFile that is read into a string. I make some modificatons to the string, and now I want to convert a string to an HtmlDocument object.
Is there a way to go about it?
Thank you very much.
|
|
|
|