|
I have two tables in my MS SQL database. The first one (Publication) contains all sorts of information about books, and has one foreign key (AuthorID). The second table (Author) contains the names of the authors. Now, I need to sort the first table, alphabeticaly, by the authors names. But all I succeeded in doing so far was to sort it by Authors IDs. If anyone has an idea on how to solve this, any help would be greatly appreciated.
Thanks.
|
|
|
|
|
I don't know, but I suspect you'll need classes from System.DirectoryServices, perhaps DirectorySearcher.
|
|
|
|
|
Hello.
I have been creating a application that checks the application version and sees if it fits with the version from http://msbeditor.dumpen.dk/versioninfo.html
If it doesnt I use a webBrowser component to open a download link to http://msbeditor.dumpen.dk/msbEditor.rar
But this is not very practical because, the ones using my application have to download all files even though some of the files are not changed..
So I wanted to ask if you have an idea on how to make a auto updater in C#?
I was thinking of something like:
Check the application version with the online version (Allready done)
If it doesnt fit, then match all the files (last changed or file size or similar) in the rar file (from msbeditor.dumpen.dk) with the files in the application folder
If they are changed then download the changed files
Any ideas?
|
|
|
|
|
Sounds okay. You can create an additional updater application that will download the files and then update your main application when finished.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you
Im glad you like the idea
But do you have any like real code for me?
Because (for me since im not that expierenced) its hard to go from idea to actullay coding it
A snippet or similar is just fine!
|
|
|
|
|
Hi.
Have you considered ClickOnce ?
Kjetil
|
|
|
|
|
Hello,
could anyone solve my problem. I have application working with MSSQL Server: there is one table "goods" (id, name) and another one - "info" (id, idgood1, idgood2, info), where idgood1 and idggod2 - foreign keys.
In my application I need to present a DataGridView in such a way,
_______| goods1 | goods2 | goods3
goods1 | info11 | ______ | ______
goods2 | ______ | ______ | info23
goods3 | info31 | ______ | info33
I select data from two tables ("goods", "info") in appropriate DataTable instances: GoodsDataTable and InfoDataTable. Then I CREATE (dynamically) one more DataTable - VisualDataTable, which IS what i need. Then I put VisualDataTable into DataSet, DataSet into BindingSource, and, finally, BindingSource into DataGridView. It's working. Until I want to update something!
I tried to call SqlAdapter's Update method as for InfoDataTable as DataSet. But nothing happens.
In general, how should I update data in case when "visual" part of DataGridView and database structure are different..?
Another words, I take data from database, and put data into database with one table, and I edit data with another table.
|
|
|
|
|
Your design is a bit blur. What I understand form your post is that you combine two tables into one, this is called DataView object which should be in the SQL server layer of your program.
Create a SqlCommand that creates a DataView combining both tables then make your SELECT/UPDATE commands on that view. Both tables will be updated accordingly.
I hope I got you right.
Regards
|
|
|
|
|
OK, I'll show an example
"Goods" Table:
id | name
---------
23 | foo1
24 | foo2
25 | foo3
"Info" Table:
id | idgood1 | idgood2 | info
-----------------------------
10 | _____23 | _____24 | inf1
11 | _____23 | _____25 | inf2
12 | _____24 | _____25 | inf3
I want to see in DataGridView such structure (first row - row header, first column - column header):
____ | foo1 | foo2 | foo3
--------------------------
foo1 | ____ | inf1 | inf2
foo2 | ____ | ____ | inf3
foo3 | ____ | ____ | ____
|
|
|
|
|
I've created a form with 'WindowState' set to "Maximized", so that the window starts in fullscreen. I don't want the user being able to restore the window back to it's original size, so I've disabled the "Maximize" button, and I've set the 'FormBorderStyle' to "Fixed Dialog".
However, I can still double-click the form and resize it back to it's original size, so I'm wondering what can I do to prevent this?
I'm using MS Visual Studio 2008 for what it matters.
Note: I'm fairly new to C#, so I'd appreciate it if you could be as detailed as possible if you got any suggestions.
Thanks in advance
|
|
|
|
|
Don't think you can prevent it happening, but you can respond and reverse the action.
Handle the "resize" event on the form (in the properties window, click the events button, find the resize event and double click on it), add some code that checks if the windowstate state is maximised. If it's not, set it to maximised.
Simon
|
|
|
|
|
You should be able to do it by overriding WndProc and intercepting the WM_ENTERSIZEMOVE (0x0231) message, or another similar message if that one isn't sent in your situation.
Dave
|
|
|
|
|
|
Perhaps set the .MinimumSize to the .Size in the Load event handler?
|
|
|
|
|
hi guys! I have a listview with a PDF's from a local folder. when the item is double clicked I want to be displayed. What is the best way of doing this? I haven't do any coding for opening PDF
's before. Thx ahead for reading this post
|
|
|
|
|
.Net doesn't provide PDF support by default. You'll need to get a 3rd party PDF library, or display it by calling external software.
PDF Library - Google for one, there's about a gazillion.
External software - like adobe or foxit. You'll need to ensure it's installed, maybe setup some kind of prerequisite in your app's installed, the call it from your software. Or possibly just open the pdf file and let windows kick in to choose the software.
Simon
|
|
|
|
|
laziale wrote: when the item is double clicked I want to be displayed.
Process.Start("pdffilename.pdf")
|
|
|
|
|
it says that access is denied
|
|
|
|
|
ok...I know what is it. I solved, the thing was that I had ToString declaration, and with that my string it get's the item from the list view like this:
"ListViewItem: {C:\\document.pdf}"
now, I did item.text, and it works perfect. Thx
|
|
|
|
|
PDF Creator/fly2pdf[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hi
I recently posted a question on ArrayList and although I would still like an answer, I have decided to use the Hashtable class instead of a 2-dim array. Anyway, I have created a small test example and am able to successfully store and retrieve values. However, I tried storing the hashtable in a session and then retrieving it but get an error on retrieving (so assume it has stored it as no error on that line). My timeout is 2000 so I'm sure that is not the problem. Anyway, here is my code:
protected void Button1_Click(object sender, EventArgs e)
{
Hashtable myHash = new Hashtable();
myHash.Add(TextBox1.Text, TextBox2.Text);
//store the hash table in a session object
Session["BooksOrdered"] = myHash;
//retrieve the details from the session object
Hashtable booksOrderedHash = new Hashtable();
booksOrderedHash = Session["BooksOrdered"];
// Loop over the list, writing out the value
foreach (DictionaryEntry myEntry in booksOrderedHash)
{
Response.Write(myEntry.Value);
}
}
The error is:
Cannot implicitly convert type 'object' to 'System.Collections.Hashtable'. An explicit conversion exists (are you missing a cast?)
Line: booksOrderedHash = Session["BooksOrdered"];
Any help would be greatly appreciated as I've spent since 10am this morning on this
|
|
|
|
|
you need to cast your Session["BooksOrdered"] to a hash table like so
booksOrderedHash = (HashTable)Session["BooksOrdered"]
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
2 minutes faster than me
That'll teach me for trying to be sarcastic.
Simon
|
|
|
|
|
hehe, let it be a lesson my friend
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Thank you very much for your non-sarcastic reply to my stupid question
If anyone is interested, here is an example to check if a value exists in the hashtable,
if (!myHashTable.ContainsKey("keyToSearchFor"))
{...
}
Today so far I'm enjoying programming )
|
|
|
|