For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I'm using VB.net and entity Framework.
I have situation where depending on several conditions I construct a query step by step .
This is the code :(Article has 2 relationship with F1 and F2)
Dim list1 As IEnumerable(Of Article)
list1 = From t In context.Articles.Include("F1").Include("F2") OrderBy t.name Ascending
If condition1 then
list1 = list1.Where(Function(t2) t2.tp = 1)
EndIfIf condition2 then
list1 = list1.Where(Function(t2) t2.id = 7)
This code is working , but now I want to add a new condition , and if this is true the child "F1" should be filtered.
I've created a Custom Control that inherits a PictureBox control. When a TestApp uses my newly created custom control, I'd like to add some additional data to the MouseMove event that is returned. Currently the raised event would appear in the TestApp as....
Private Sub MyCustomControl_MouseMove(sender as object, e as MouseEventArgs) handles MyCustomControl.MouseMove
My first thought was to add additional arguments such as....
Private Sub MyCustomControl_MouseMove(sender as object, e as MouseEventArgs, MyExtraArgument as double) handles MyCustomControl.MouseMove
or as an alternative, add my extra argument to the MouseEventArgs class so it would appear as...
Is either of these methods possible? I'm under the impression that these events/objects may not be overridden without being able to modify the original source code of the parent control. Are there any simple examples of doing either of these techniques? Ideally I'd like to keep all the code within my newly created control library so that the TestApp doesn't require anything other than dropping the newly created child control into it.
I have project in vb.net using a sql server 2008r2 database and Entity Framework.
Several clients are using this program.
But sometimes I make modifications to program and to database structure ( for example new fileds are added to several tables , new tables are added...etc ).
I give to the clients the new ".exe" file , but the problem is that their database is not up to date according to my last modifications.
Let's suppose that I have the new database model as a empty SQL server backup file "Model.bak".
I want to add in my applications a "Update Database" command. This command should do the update process of the current client database according to the new structure of "Model.bak".
I want suggestions , how can I do this on vb.net ? ( I don't want to do this with other tools and programs. I want to give users only the new ".exe" file and the new template "Model.bak" and do te update process from my application )
I read somewhere that is possible to prepare a updating sql script that can do this process.
If this Is true , I have some questions :
1) How this script can be created ?
2) Is possible to store this script inside the "Model.bak" file , and to call inside my program ?
If this story of the script it's not true , any other suggestions ?
Thank you !
Thank you !
But as I understand , this article speak for Code First.
In my case I have first created the databse on sql server management studio , after using wizard inside VB.net I created the entity. It seems I'm using Databae First , or I'm wrong ???
So in my case how can I use this solution ?
I'm not going to be able to help with the EF stuff, can't stand the tool myself, but!
A .BAK file is a backup and therefore has absolutely nothing to do with your scripting changes to the database. And cannot be used as such AFAIK.
We use Red-Gates SQL Compare to generate the change scripts, but you can create the script manually. That script then needs to be transported to and run against your clients server. You could get your app to check a folder for a .sql file on startup, if it finds one then open the file and run the script of the connection in the app. Then archive the .sql so it cannot be automatically run again.
Never underestimate the power of human stupidity
Thank you !
For transporting this script , I think to have a one-field table inside the database . This field will keep the update script.
I want to give users only the new .exe file and the Model.Bak.
Is possible that inside my application to have a code that read this field inside the Model.Bak , get the script and run to update the current database on that computer ?
Maybe it's a stupid idea , but I want to find a way to give users only the exe file and the new Model.Bak , and they can make update process inside my program.
Thank you !
I have just added functionality through a 3rd party API to a large programming project of mine. The 3rd party API requires me to set the target CPU to 64 bit for it to work on my machine.
So far so good. The section of the program which uses the API is working like a charm.
But here's the problem. Previously I was relying on API calls to SetCursorPos in another, previously totally functional part of the program. Those API calls no longer work as expected and the cursor is placed in bizarre locations when I try to call that after a 64 bit compile. If I set the target CPU back to x86 or AnyCPU, SetCursorPos works like a charm again -- but not the new 3rd party API based stuff.
I've gone searching and have found hints of other people having problems with the functionality of SetCursorPos on a x64 targeted compile, but haven't yet found any good workarounds. Thoughts?
I created an access Lyric database. Then I added a table and a combo to hold song file data. Then, when the user selects a song and clicks play the code below gets executed. When I first did this it went well. WMPlayer opened up and played the song. Now it opens up the open dialog wanting me to select the file. It returns a 42. This is the first time I used this API command. Any help will be appreciated.
The user actually selects the filespec (path & filename) from the open dialog box. I split the filespec into Path and filename and store each into their corresponding fields in a record. I know the path is correct because the open dialog opens to the correct folder. This was working great, but now It does this. I would sure like to find out what the return values of this API function mean. I tried every number fro 0 to 10 in the show parameter of the shellexecute API call.
The record is define as:
MP3Seq autonum index
I wanted to be able to save more then one song file. The artist's version and a karaoke version. That's what the MP3VerID is for.
The MP3ID field is the same as the autonum field in the lyrics table.
I have had this program for a number of years. VB's Shell has been used all this time. But now on Win 7 I get a security message blocking me from using it. That's when I discovered ShellExecute.
That was a big help, i only have one small problem
i need to find LNCActivex.ocx. the link to install it doesnt work.
I have searched the net and find plenty of apps that want to check all your files
and tidy them up.
Any idea where i could find it ?
Thanks a mil.
Last Visit: 31-Dec-99 19:00 Last Update: 31-Jan-15 20:25