Cephid's Q&A profile
Windows Forms Bold and Ubold
Hi i have created a simple editor and i have a text which is bold and underline i want to remove the bold but keep the underline the question is how to remove a style and keep the other You need to set the control's font to a new font, created using the existing font, with a font style that removes the desi ...Show All
Visual C# Working with database data in textbox controls instead of datagrid?
I've learned how to display/update data from a database in a datagridview control. But when working with one row at a time, i would prefer to make a nicer GUI, with textboxes/checkboxes etc. Are there any easy way i can achieve that Reading and displaying is one thing, but what about updating Does anyone know where i can find any tutorials that demonstrates working with data in other controls than the datagridview Example: A GUI with a button that fills the textboxes with data from a data source, a button that updates any changes to the db, and buttons that lets me select previous/next records. Btw, i'm working with a Mysql database, so i ...Show All
SQL Server I hate this
I'm migrating a fu... dts to SSIS. That's fine. I've got a derived column task for stuff as cdbl(DTSSource("Col014") /100). But how the source plain file have a lot of columns suddenly I find this: Function Main() Fecha=Right(DTSSource("Col014"),2) & "-" & Mid(DTSSource("Col014"),5,2) & "-" & left(DTSSource("Col014"),4) If IsDate(Fecha) then DTSDestination("FechaOp") =Fecha Else DTSDestination("FechaOp")=null End IF Main = DTSTransformStat_OK End Function So that 'Derived Column' is useless at all for to encompass this rule unless t ...Show All
Visual Studio Undoing checkout
Hi everybody, I'm trying to implement a continuous integration process here, and I'm using the following article as a baseline: http://dougrohm.com/cs/articles/56.aspx There's one thing there that's giving me problems, though. In one of the steps on the process described on the article, a "version.txt" file gets checked out, modified, and then checked in when the process is done. If there's a problem and the build process fails, the file never gets checked back in. Then say the problem with the build got fixed. In theory, the next build should succeed. However, it's failing because it can't check the version.txt file out, ...Show All
SQL Server Nested Table Relations in SQLXML
Hi Folks This question applies to SQL Server 2000 and SQLXML. I have a table with columns as follows: AccountID ~ ParentAccountID ~ AccountData Sample data: 1 ~ NULL ~ This is a parent account 2 ~ 1 ~ This is a child account As you can see, there is an inherant tree structure in the above data: ParentAccountID is a foreign key to Primary Key AccountID. I wish to query these using a FOR XML and retrieve a document like the following: <account> <accountid>1</accountid> <accountdata>I am a parent account</accountdata> <account> <accountid>1</accountid ...Show All
.NET Development XPATH CONTAINS
I filter/search an xml-file, and this works: XmlDataSource1.XPath = "NewDataSet/tbl_arenden_kw[contains(@rubrik_kw,'" + TextBox1.Text + "')]" I try to filter/search in all nodes, but it does not work (no records): XmlDataSource1.XPath = "NewDataSet/tbl_arenden_kw/@*[contains(.,'" + TextBox1.Text + "')]" Do you have any ideas Thanks in advance Clas Yes, it works, but I must use @ XmlDataSource1.XPath = "//tbl_arenden_kw[contains(@arendetext, '" + TextBox1.Text + "') or contains(@rubrik_egen, '" + TextBox1.Text + "')]" Thanks, The XML Man and Joost Ploegmaster for your help ! ...Show All
Windows Forms Simplest inherited control
Hello all, Just started looking at user controls for creating composite user interface elements, this is great in visual studio 2005. What I am now trying to do, is create a simple button control (with a couple of extra fields and a common look, let's just say red for this example). all the functionality I need apart from the extra fields is already in the button class. All I want to be ale to do at design time is adjust the size of the button accordingly (the button will obviously already be red after dropping it on to the form) to fit with different places in my application . Can anyone tell me how to do this I have look ...Show All
.NET Development SSL X509Store
I have created a certificate with makecert.exe -sr LocalMachine -ss MY -a sha1 -n CN=test -sky exchange -pe cert.cer makecert.exe import the cert into the certification store. But i delete the cert in the certification store because i would add the cert to the store with my server app. Here is the code, all works fine but Server.AuthenticateAsServer(cert) don't work... Private cert As New X509Certificate2("C:\cert.cer") Dim stor As New X509Store(StoreName.My, StoreLocation.LocalMachine) stor.Open(OpenFlags.ReadWrite) stor.Add(cert) stor.Close() Server.AuthenticateAsServer(cert) ...Show All
.NET Development FtpWebRequest re-sending USER and PASS commands half way through download loop
Well, the title says it all really: I'm using FtpWebRequest to download multiple files as follows: private string GetFile(Uri uri) { string un = Misc.ReadRegKey("ParserFtpUsername"); string pwd = Misc.ReadRegKey("ParserFtpPwd"); string file; NetworkCredential cred = new NetworkCredential(un, pwd); WebProxy pxy = new WebProxy(); pxy.UseDefaultCredentials = true; FtpWebRequest wr = (FtpWebRequest)WebRequest.Create(uri); wr.Credentials = cred; wr.Proxy = pxy; wr.UseBinary = false; wr.Method = WebRequestMethods.Ftp.DownloadFile; FtpWebResponse resp = (FtpWebResponse)wr.GetResponse(); ...Show All
Visual C# How do you change the value of an already created cookie?
Below is the code I'm currently using on my login page to save the username and password. I'm going to later encrypt it but for now I'm simply setting it. HttpCookie UNcookie = new HttpCookie("TheUsername",txtUsername.Text); UNcookie.Expires = DateTime.Now.AddYears(1); HttpCookie PWcookie = new HttpCookie("ThePassword",txtpass.Value); PWcookie.Expires = DateTime.Now.AddYears(1); Response.SetCookie(UNcookie); Response.SetCookie(PWcookie); The code works great the first time I run it. If I go back to the page I am presented with the information that was saved. If a new user logs in on the same machine and acct, the ...Show All
Smart Device Development CenterWindow() no longer works on WM5 ?
Hi all, I want to display a model dialog and center it, I used CenterWindow() inside OnInitDialog function to position the window successfully on eVC++3.0 MFC application. When I did the same to a WM5 fresh new MFC project, it did not work out. I have to manually set the X-Pos and Y-Pos in resource to make it center on screen. Is there any better method to center a dialog on screen Hi, I have tried the same on the desktop code and the code is working there. I shall confirm if for the devices, CenterWindow() is intended to draw the window in the center or not and shall reply soon. I ...Show All
.NET Development How i get new ID after inserting data in table through command.ExecuteNonQuery
Hi, I want to get newly inserted ID after inserting data in table. I am using command object's ExecuteNonQuery. I don't want to use MAX in another query. Is there any way to do. I am using ad-hoc query not a storedprocedure. Also i don't want to use @@identy because it is a global variable and at the same time if any other insert statement fires the value of @@Identy Thanks in Advance..... Mahseh... @@identity is limited to the current connection, so you will get the last id of the record that was inserted within the same 'connection' as the connection that you use to do the select @@identity. You can also ...Show All
Visual C# CodeDomProvider.CreateCompiler - need a replacement.
I am posting it second time today. For some strange reason the first post disappered after an hour or so. It is about the method: CodeDomProvider.CreateCompiler(). The method appears to be obsolete but it is used in a code sample I have copied from MSDN. There should be a replacement for this method. I would like to know what it is. Thanks. All the methods from the ICodeCompiler interface have been moved to CodeDomProvider itself. So you dont need to call CreateCompiler on a CodeDomProvider instance. You just use the CodeDomProvider instance itself. FYI: this is described in the MSDN docs for ICodeCompiler Hope that helps. ...Show All
SQL Server sql question
Hi i created a table that has 3 columns and the primary key is ID and has the Identity turned om .. she will increment herself bye 1 every time new row is added my problem is... when i delete a row.. i want all values in the primary key atuomaticly go 1 back.. ( in MySql the auto increment did that) example: ID | Something ----------------------------- 1 | aa 2 | bbb 3 | cccc 4 | dddd 5 | eeeeee command: delete from table where id=3 Result: ID | Something ----------------------------- 1 | aa 2 | bbb 4 | ddddd 5 | eeeeeee but i want to be this way: ID | Something ----------------------------- 1 | aa 2 | bbb 3 | ddddd 4 | ...Show All
Smart Device Development RESET POCKETPC
hi ; i have a problem : i must to make a soft reset of the my device in csharp; how can i make it thanks alessandro Please see this: http://www.danielmoth.com/Blog/2005/03/please-read-before-posting-to-ng.html And this: http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/fc11d051f1d376ed/aca91da047530175 q=soft+reset&rnum=7#aca91da047530175 ...Show All
