|
Hi,
I have ODBC connectionstring , say, "DSN=xyz, trusted_Connection=yes"
I want to generate equalent SQLClient connectionstring from the available ODBC connectionstring, say, "Server=abc,Database=db, UID='',PWD=''"
Actually i am trying to redirect all connections using ODBC provider to native SQLServer provider.
Is there any way?
Thanks
kumar
|
|
|
|
|
Hey Guys,
Heres another one for ya
I'm inserting data with a liststore(gtksharp) and my problem is that the data I'm inserting allows you to insert rows at a time and my columns are dynamic(coming from a csv file) so for example
musicListStore.AppendValues (multiarray[gtkrow,gtkcol], multiarray[gtkrow,gtkcol+1], multiarray[gtkrow,gtkcol+2]);
This allows me to add data to the current row, called from my multidimensional array, multiarray.
Anyway every time multiarray is called it adds another 'cells' worth of data to the row for in this example there are 3 columns in my sheet. But for example if I decide to open a sheet with 6 columns the next 3 would be missing, the only idea I can come up with is an
if amtofcols = 6 then multiarray[gtkrow,gtkcol]....... mutiarray[gtkrow,gtkcol+5)
etc etc, but with the csv's we're using there is not upper limit and its not the nicest code at all, there must be a more elegant way of doing it but I yet to figure it out.
Entering data a 'cell' at a time is also proving impossibly hard to find information about and I realise this is a gtk widgit so people maynot have much experience but I thought it was worth a shot.
Any help or suggestions appreciated.
Cheers
Tom
|
|
|
|
|
Hi All,
Trying to write a little application to export DFS information from Active Directory and disply the Active DFS link. I've found the objects i need, but unsure how to handle the Partition Knowledge Table (PKT) attribute.
The description from Microsoft is;
"The PKT is a sorted lookup table that requires about 400 bytes per entry. One PKT resides in Active Directory for each Dfs root in a domain-based Dfs. The PKT for a stand-alone Dfs resides locally in the registry."
It seems the PKT attribyte is System.Byte[]. When i export this and convert to string (just so I can see what it produces) i get the following;
"\domainroot¬㨾껷䍖뗵⏢\DOMAIN\DATA\DOMAIN\DATA:.SERVER1DATAĬ`\domainroot\37ca6fad-bb48-45cb-be26-ae234dc71717Â澭㟊뭈䗋⚾⎮읍\DOMAIN\DATA\DRIVERS\DOMAIN\DATA\DRIVERS곰ኞ艍LJ곰ኞ艍LJ곰ኞ艍LJ@4SERVER2drivers܈\siteroot䄻厔䈪궴嫛討 "
I can see the information i'm after (which should be \\SERVER2\drivers) but unsure the best way of getting the information out.
Any ideas?
|
|
|
|
|
Hi!
I am trying to launch from code the default email client. Here's how I do it:
emlText = "mailto:" + strAddress + "?subject=" + strSubject + "&body=" + strBody;
System.Diagnostics.Process.Start(emlText);
If the body text is smaller than 2024 characters the client launches perfectly. If it exceeds 2024 characters I receive an Access Denied exception.
Can anyone please tell me how can I overcome this problem? Thanks
|
|
|
|
|
The reason it's not working is because the maximum length of a query string in IE is 2048 characters.
Check System.Web.Mail for sending emails.
|
|
|
|
|
I figured that out ...but I do not trust SMTP... maybe there is another way
|
|
|
|
|
How to send bulk emails embedded with images? Please provide Examples or code snippets
Shrikant
|
|
|
|
|
Sounds a little suspicious -- you're not doing spamming software, are you?
|
|
|
|
|
Hi,
I am facing problem of counting words for .doc or .txt files.
I am using following methods ,
1.
aDoc = wordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
aDoc.Activate();
aDoc.Select();
int WCnt = aDoc.Content.Words.Count;
2.
aDoc = wordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
aDoc.Activate();
aDoc.Select();
string ToCount = aDoc.Content.Text;
int RCount = ToCount.Split('\r').Length;
int WCnt = ToCount.Split(' ').Length + RCount;
Still it is not counting words properly.
Please tell me proper method to count the words in .doc or .txt file correctly.
#Abhi#
|
|
|
|
|
Hi All,
Is there any open source tool like Castor(for java) to convert XML/Schema to C# classes in .NET other than xsd.exe?
Thanks in Advance.
Gokulan
|
|
|
|
|
|
Hi All!!!
I´d like to know if somebody can give any idea, cause I don't know what else to do:
Scenario:
ASP.NET GridView, linked to a Customer Object (public/private properies) through a ObjectdataSource
The Thing is that when I am doing the Update of the Grid, the Object Customer arrives with all the data to the BLL, but when I am clicking in the Delete one, the object arrives empty to the BLL.
I have debuged it, and in the "Deleting Event" of the Grid, the values for the parameters are there, but in the "Deleting Event" of the Object DataSource the values dissapear...
Can anybody give any ideas
Thanks and Regards
Ricardo Casquete
|
|
|
|
|
Hello,
I am creating a GUI in C# which is like a Outlook sidebar and containing controls of Views, Sources and Displays instead of Mail, Calendar & Notes etc.
The Client UI is getting these sources and views from the server/backend. I want to populate these resources in respect of my controls. Say if I click on Views - I wud be able to see the list of the availiable views on the server-side.
Can somebody help me in this with a sample or any link.
I am quite new to C#. I have already got a code snippet to create Outlook Style sidebar.
Any help will be appreciated.
Thanks,
Kapil
|
|
|
|
|
Kapil Singhal wrote: I am quite new to C#. I have already got a code snippet to create Outlook Style sidebar.
Seriously, if you're new to C#, you shouldn't be taking on a project of this complexity. Piecing together snippets you find online is not programming, and will bring you to grief if you don't know enough to understand what they are doing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks a lot for the advice.
I do agree that I am new to C# in developing GUI but I know the language.
I am not using any one's code for my own development. I just using their design and then modifying that according to my project. I think I able to do this only if I am able to understand the langauge.
As for the my project, complexity is there but yes I can learn and achieve my target. But i think I need help from people like you in learning the complexities of the GUI.
The same application is being created in Java by my collegaues and I am creating it in C#.
Thnaks & Regards,
Kapil
|
|
|
|
|
I want to make my class serializable. It only has a few fields and I want to store the settings as XML. At the moment I use an XmlSerializer to serialise and deserialize the object but I have all the code in my program's main() method. What I want is to create an instance of my object in my main() and just call the object's own deserialize() method. What's the best way of doing this?
Currently:
MyObject obj;
XmlSerializer s = new XmlSerializer(typeof(MyObject));
TextReader r = new StreamReader("myobject.xml");
weights = (MyObject)s.Deserialize(r);
r.Close();
Prefer:
MyObject obj = new MyObject;
obj.deserialize();
I just want to say as well that there are so many examples out there that ignore the idea of object-oriented programming. If an object is serializable then that object should handle its own serialization. The necessary serialization code shouldn't end up in some separate method in the main() function.
|
|
|
|
|
I may not be sure about my reply but we can create a class with the structure and define the properties for each field in the class ex:
class MyObject
{
int _intVar;
[XmlElement("IntVar")]
public int IntVar
{
get
{
return _intVar;
}
set
{
_intVar = value;
}
}
}
where the xml file contains the IntVar element.
Using the XmlElement related attributes for serializing and deserializing can be achieved.
ALL THE BEST
|
|
|
|
|
Construction from serialized data can be substantially cheaper than default construction and replacing the properties with deserialized data.
|
|
|
|
|
Asalam o Alaikum:
I am getting problem while finding the ListView Header text through SendMessage()
Does any body Knows
Thanx
|
|
|
|
|
Is there any particular reason you are using SendMessage() instead of
<br />
myListView.Columns[columnIndex].Text<br />
|
|
|
|
|
Actually i am trying to get ListView Header text from other application.
So i have to use SendMessage();
there are other functions like LVM_GETITEM ,i am in a search of this kind of function.
Thanx
|
|
|
|
|
Here's a sample on how to do it (just copy / paste the code and build it)
<br />
public const UInt32 LVM_FIRST = 0x1000;<br />
public const UInt32 LVM_GETCOLUMN = LVM_FIRST + 95;<br />
public const UInt32 LVCF_TEXT = 0x0004;<br />
<br />
[StructLayout(LayoutKind.Sequential, Pack=8, CharSet=CharSet.Auto)]<br />
public struct LVCOLUMN <br />
{<br />
public uint mask;<br />
public int fmt;<br />
public int cx;<br />
public IntPtr pszText;<br />
public int cchTextMax;<br />
public int iSubItem;<br />
public int iImage;<br />
public int iOrder;<br />
}<br />
<br />
[DllImport("User32", CharSet=CharSet.Auto)]<br />
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, UInt32 wParam, ref LVCOLUMN lParam); <br />
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
int iTextSize = 255;<br />
IntPtr pText = Marshal.AllocHGlobal(iTextSize);<br />
LVCOLUMN lCol = new LVCOLUMN();<br />
lCol.mask = LVCF_TEXT;<br />
lCol.cchTextMax = iTextSize - 1;<br />
lCol.pszText = pText;<br />
uint nIndex = 0;<br />
SendMessage(listView1.Handle, LVM_GETCOLUMN, nIndex, ref lCol);<br />
System.Diagnostics.Trace.WriteLine(Marshal.PtrToStringAuto(pText));<br />
Marshal.FreeHGlobal(pText);<br />
}<br />
}<br />
}<br />
I hope that not naming my controls properly will not bother you The demo uses list view on the same form, but I assume you already know how to get the handle of the listview, and replace it in the code above.
Cheers,
Svetlin
|
|
|
|
|
Thank you for ur reply .this code is working fine but when i pass the handle of the listview from some other application it does not return anything
can you have any idea please
Thanx
|
|
|
|
|
ya. i got that
i tried to p[ass the exceptio than ther dataset.
that was some connection problem now its working properly
thanks
My small attempt...
|
|
|
|
|
I am about to write an application in which is is needed to which language online.
The article : http://www.codeproject.com/csharp/formlanguageswitch.asp
tells how to do that, and it works.
My problem is then to get the resource translated. The translator do not have Visual
Studio installed. Therefore I would preper to export the resource from Visual Studio
to e.g. Excel, let the translator do the job in a seperat column, and the import the
resource to Visual Studio again.
But I have not found any tool which can do that. Do anyone know if this is possible
and then how it is done?
or is there another way to solve my problem?
|
|
|
|
|