|
Hello,
VS 2005
Strange problem with my visual studio.
I have typed datasets in the designer. I have table adapters that i have dragged from the server explorer. I have used these for the last couple of month. I have added queries, stored procedures, added and deleted fields in the table adapters.
Now, I added an extra column to one of my tables in sql server 2005. I right clicked the relevant table adapter and clicked configure, and included the extra column.
I build the program, but the changes to the table adapter does not reflect in the code. When I do the following: tableAdapter.insert() the extra column has not been included.
I tried this with another table adapter in the dataset designer by adding a new field. The same problem.
I used rebuild, i have deleted the table adapter and added a new one. I have restarted VS, and also restarted the computer. I have also opened the project on another machine. I have deleted the table adapter from the form designer and added a new one from the components tab. And still the same problem.
When I preview the data, the extra column is there. But not when I use it in code.
Can anyone please tell if they know about this problem and is there a way to solve it.
Many thanks if you can.
|
|
|
|
|
Hi Steve,
I have experienced a somewhat similar problem with datasets in VS 2003. Although I am still not sure how or why it happened, I managed to solve the problem by creating a new dataset with a another name and changing all references to the old dataset to the new one. So in your case for example you could delete the existing tableAdapter or keep it (same difference), and create a new one with the name tableAdapter1. Then just roam through your code and add a 1 where necessary.
Hope it helps,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I've been trying to get an application that can compile code at runtime, then save it as a .exe file.
So basically what I did was go on MSDN, 'steal' some code (yeah, I know I shouldn't...) that compiled VB and try to change it so it could also save it.
Public Class Form1<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
CodeEmitter.RunCode("Microsoft.VisualBasic.MsgBox(" & """" & "Hello World" & """" & ")")<br />
<br />
End Sub<br />
End Class<br />
Class CodeEmitter<br />
<br />
Shared Sub RunCode(ByVal code As String)<br />
<br />
Dim cmplrParms As New CodeDom.Compiler.CompilerParameters<br />
<br />
cmplrParms.GenerateExecutable = True<br />
<br />
cmplrParms.OutputAssembly = "C:/VBCompile.exe"<br />
<br />
cmplrParms.TreatWarningsAsErrors = False<br />
<br />
cmplrParms.WarningLevel = 4<br />
<br />
cmplrParms.ReferencedAssemblies.AddRange(New String() {"System.dll", "Microsoft.VisualBasic.dll"})<br />
<br />
code = String.Format("Public NotInheritable Class EmittedClass{0}Public Shared Sub DoWork{0}{1}{0}End Sub{0}End Class", Environment.NewLine, code)<br />
Dim pvdr As New VBCodeProvider<br />
<br />
Dim rslts As CodeDom.Compiler.CompilerResults = pvdr.CompileAssemblyFromSource(cmplrParms, code)<br />
<br />
MsgBox("Path: " & rslts.PathToAssembly)<br />
<br />
Dim assmbly As Reflection.Assembly = rslts.CompiledAssembly<br />
<br />
Dim t As Type = assmbly.GetType("EmittedClass")<br />
<br />
t.InvokeMember("DoWork", Reflection.BindingFlags.InvokeMethod Or Reflection.BindingFlags.Public Or Reflection.BindingFlags.Static, _<br />
Nothing, Nothing, Nothing)<br />
<br />
End Sub<br />
<br />
End Class
The original code worked until I changed
cmplrParms.GenerateInMemory = True
to
cmplrParms.GenerateExecutable = True<br />
<br />
cmplrParms.OutputAssembly = "C:/VBCompile.exe"
Now I get an error FileNotFoundException at
Dim assmbly As Reflection.Assembly = rslts.CompiledAssembly because it turns out that nothing was ever compiled to C:\ in the first place!
Thanks in advance for any help!
|
|
|
|
|
I thought Windows used baclward slashes to separate directories.
ROFLOLMFAO
|
|
|
|
|
Tried that
Doesn't work
EDIT: I found a fix for it. Thanks for trying to help!
-- modified at 7:19 Monday 2nd April, 2007
|
|
|
|
|
Sir/madam.
I am facing a problem i button text.
The problem is i am passing a button control as an argument
like following is my form
i have a function there and in the function signatures i am passing a button control as a argument.
The problem is i am not getting the text of the button in the myclass class.
the object b shows t.text is blank("")
class form1
private sub fun()
dim obj as new myclass
obj.funct(Button1)
'Button1 is name of the button in the form.
end sub
end class
class myclass
public sub funct(byval b as button)
messagebox.show(b.text)
end sub
end class
Please help.
I am using vb.net 2003 Window Application.
Thanks and regards
Pankaj
|
|
|
|
|
Myclass is a reserved word.
Private Sub fun()
Dim obj As New class1
obj.funct(Button1)
'Button1 is name of the button in the form.
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
fun()
End Sub
End Class
Class class1
Public Sub funct(ByVal b As Button)
MessageBox.Show(b.Text)
End Sub
End Class
|
|
|
|
|
could anyone help me please?
I wanna make 3D graphic with VB.NET.
I wanna rotate 360 degree that 3D graphic images.
phowarso
|
|
|
|
|
I don't know if VB's the best way to do that.
Try XNA
|
|
|
|
|
Christian already gave you the correct answer to your question here[^]. Asking the same question again will not change the answer.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
WPF (.NET 3.0) includes support for 3D.
|
|
|
|
|
Hi everybody.
I have a website where users can upload their pictures. I need to automatically add the name of my website to any uploaded picture. is that possible? and How?
Thanks in advance...
OmarMallat
|
|
|
|
|
Create a MemoryStream from the uploaded data, so that you can load the image into a BitMap object. Create a Graphics object for the bitmap so that you can draw on it. Save the BitMap to a file.
---
single minded; short sighted; long gone;
|
|
|
|
|
ok, but can you give me how to write to an image? and how to save it again? this is my question
OmarMallat
|
|
|
|
|
Use the Graphics.FromImage method to create a Graphics object for the image. The Graphics object has method that you can use to draw anything you want on the image, like text, shapes and other images. Use the Save method on the image to save it when you are done drawing on it.
---
single minded; short sighted; long gone;
|
|
|
|
|
ok, but I'm new in web development. in windows application it's easy to do that, but in web development how to put an exe file on the server to perform this task?? and how to call this exe? and how the exe can save directly to the server? or there is another concept?
the view about this is not very clear...
OmarMallat
|
|
|
|
|
You don't have to do this in a separate program at all. The entire framework is available from within ASP.NET.
---
single minded; short sighted; long gone;
|
|
|
|
|
sorry but I can't understand how..
let we have a simple example.
I need to make a copy of each uploaded file..
in windows application: filecopy source, destination
build, and double click to copy the file
in web what should I do?
please, do not say that I'm stupid... but I don't know...
OmarMallat
|
|
|
|
|
It works exactly the same in a web application. Put the code in the page, deploy the application, browse to the page.
There is one difference, though. The working directory is not the folder of the web application, so you have to use complete file paths. The Server.MapPath method gives you the physical path of a virtual address.
---
single minded; short sighted; long gone;
|
|
|
|
|
Another option would be to create a custom HttpHandler that watermarked the images "on-the-fly". That way, you don't have to modify the original image stored on your server. The watermark can be added as the picture is being sent to the client browser.
See this[^] article for an example. It starts about half way down the page.
There's also some information in there about stopping images from being leeched from your site without using the page that the image is a part of.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I was wandering if there was any way to supply a new set of arguements to an already running process using vb or any other language whether it be dos, c++ or c# ?
I have a program i have written that not only edits files but launches a program with a set of arguements from the user, and this works fine but i want to add functionality to my program by adding a way to change the arguements supplied to the process without haveing to shut the entire process down.
|
|
|
|
|
I think you can use some sort of IPC (Inter Process Communications) or, if your process has access to shareable resources (such as files or databases), it can poll for changes there.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I appreciate the input, im currently researching the ipc and how this may help my application along. Basically the program allows users to launch a specific executable and use information from ini files (user specified) to pass arguements to the process prior to launching (thus avoiding writing multiple bat files). But after the process is launched the user pretty much looses control of that executable (this is the manufactures fault) and im trying to find a way to give some control back to the user. Basically what im trying to accomplish is getting the process to restart (without shutting down completely) with a new set of arguements thus giving it more functionality.
As i just started reading the about ipc i havent quite come to the conclusion if this will be what i need or not, i have seen that it has the ability to pass info thru networks ect... but havent gotten all the time to read more into it.
If anyone knows how ipc works or any other way to accomplish my task i would appreciate the input.
Thanks in advance
|
|
|
|
|
BTW you can also change the values inside the INI file. But then your process has to periodically check the INI file for changes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have buttons in my menu strip on my MDI parent form. How can I center these buttons on the menu strip???
|
|
|
|