|
|
Dim con As New SqlConnection("Data Source=eyetech\sqlexpress;Initial Catalog=TBase;Integrated Security=True" providerName="System.Data.SqlClient" )
Dim MyCommand As New SqlCommand
con.Open()
MyCommand.Connection = con
Dim proc As String
proc = "EXEC SP1 " & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "'," & TextBox4.Text
MyCommand.CommandText = proc
MyCommand.ExecuteReader()
DADAX
|
|
|
|
|
dadax_85 wrote: proc = "EXEC SP1 " & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "'," & TextBox4.Text
very dangerous!
using these code instead:
[C#]
SqlCommand cmd = new SqlCommand("SP1", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ID", TextBox1.Text);
cmd.Parameters.Add("@Name", TextBox2.Text);
cmd.Parameters.Add("@Decription", TextBox3.Text);
cmd.Parameters.Add("@ProjectID", TextBox4.Text);
cmd.ExecuteNonQuery();
-- modified at 21:55 Sunday 23rd April, 2006
|
|
|
|
|
hi all
i want to retrive an image from database in an imagebox, when the image appear it appear in another page so plz help me to retrive it in an image box .
thanks
-- modified at 3:59 Sunday 23rd April, 2006
|
|
|
|
|
To show an image in an IB, just set the "ImageSrc" property.
What do you mean by "appear in another page", and show some source code and can help
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
hi
that's the code to retrive the image from a Ms-sql databse
===================================================
Dim stream As MemoryStream = New MemoryStream()
Try
connection.Open()
cmd = New SqlCommand("select img_name from Product_image where imageID='16'", connection)
Dim image() As Byte = CType(cmd.ExecuteScalar(), Byte())
stream.Write(image, 0, image.Length)
Dim bitmap As Bitmap = New Bitmap(stream)
Response.ContentType = "image/gif"
Bitmap.Save(Response.OutputStream, ImageFormat.Gif)
Finally
connection.Close()
stream.Close()
End Try
============================================================
the problem that i can't retrive this image in an image box it retrives in another page and i want it to appear in the same page in an image box
thanks
|
|
|
|
|
OK - looks like what is happening is that you're just writing the bitmap to the response stream....so essentially, what you're seeing is that the browser is "redirected" to a page with just the image on?
In order to show the image in the image box, you'd need to do something like imageBox1.ImageSrc=Bitmap
Google can help further...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
the problem that i use asp.net 2.0 and i didn't found anything image1.imgsrc, and that what i search for, so if you know a function like this tell me. i also search on google and code project but i didn't find anything untill now
thanks
|
|
|
|
|
Hi there,
You can place your sample code to read the image data from DB in a web page, say ShowImage.aspx, then in the web page containing the Image control, you can simply specify the ShowImage.aspx in the ImageUrl property of the Image control.
|
|
|
|
|
Hi there,
You can declare the dropdownlist in the the TemplateField of the DetailsView control, and simply use an additional datasource control to use with the dropdownlist. You can see an example[^] here to see how to customize the DetailsView control.
|
|
|
|
|
hi all,
i currently have a webservice that relies on a file version object. Well before i realised the System.Version class existed i created my own. my webservice worked fine, then i found system.version and deleted my class so i could use .net lib.
now i cannot get rid of the Version class from within the reference.cs files that are generated. i have changed any variables to Version to System.Version (all input params local vars) and i still get the Version class generated.
if i manually delete the Version class from the Reference.cs classes it works to the point where it has to send the Version object to the webservice. A version object with version #1.1.1.1 appears to the webservice as 0.0. i assume because it is using my old Version reference, which has nothing in it at all.
how can i get rid of this version reference so it just uses the .net lib Version class?
kind regards,
g00fy
|
|
|
|
|
I have just converted my page to use a master page. On the master page i have a page_load method that displays something. But onthe slaves pages, i also have a page_load method that displays other things. I find that page_load method will not work br run on slave pages. What can i do to make these methods run?
-- modified at 22:01 Saturday 22nd April, 2006
|
|
|
|
|
I have used MasterPages, and my Page_Load events on content pages are fiering just fine.
Could you provide more information. Why are you assuming your methods are not called?
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi there,
When working with the Master Pages, you should remember the sequence in which the events of the master page and content page occur, the Page_Load of the Master page happens after the Page_Load of the content page, you can read more about this in MSDN[^]
|
|
|
|
|
In my master page, I have a contentplaceholder, which lets the content page insert the correct controls.
The master page has its own page_load, which populates some of the stuff on the page.
My content page has a page_load as well. It programmaticlly adds control to the content place holder in the master page.
But it doesnt seem to work
In the master page i have a lavel called lblerr
I tried to put this code in the content page to see if it shows up properly
lblerr.Text="blah blah black sheep"
but it doesnt work, it seems like that the page_load for the content page never ran
How do i solve this?!@#!
-- modified at 16:15 Sunday 23rd April, 2006
|
|
|
|
|
|
hey
i need to know how i can include a file aspx
( some people tell me response.writefile(filename) but it did'nt work coz
it used just for html page )
10x for help
DADAX
|
|
|
|
|
dadax_85 wrote: i need to know how i can include a file aspx
What do you mean by this - include where?
If you mean a code-behind file, then use the CodeFile attribute of the Page
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi there,
In the old days of the classic ASP, you would normally use the include method to include the file, however it's no longer supported in the ASP.NET, and it provides a couple of alternatives:
+ You can convert the aspx file to the web user control, then simply add it to the web page.
+ You can use the Master page (with the ASP.NET 2.0).
+ You can use the Server.Execute[^] method to execute the aspx file, then add the result markup to the output stream of the Response object.
Just some ideas.
|
|
|
|
|
Hi,
I have designed a user registrtion from using HTML tags.Now I have to populate the form with the values from the database.The code goes like this
Male
Female
January
February
March
and soon till december
Now my problem is I have a month field in database which stores 01,02,03,... for months of the year.
I should make the selected property true for that month which is in the database means if the value in the column is 01 then January should be seleted ,if the value in the column is 02 then February should be seleted...
this is very imp for my project.So kinldy some one help me at the earliest.
For textboxes I used the <%%> tags to populate.But for list boxes I am not getting.I am checking for database valued for 01,02,03,... and trying to make the selected value true.But it is not working.
Regards,
Uma
|
|
|
|
|
why didn't you use server controls instead of html controls?
|
|
|
|
|
the module is already developed using html controls.Now I have to continue with that.No chance of modifying it.So help me if possible.
Regards,
Uma
|
|
|
|
|
So you mean You are not supposed to make the html control RunAt=server.
can you try something like this
<option value="feb"<%# DataBinder.Eval(Container, "DataItem.Month").ToString() == "02" ?"Selected":""%>>2</option>
|
|
|
|
|
can u pls brief me abt Databinder.Eval(Container,"")... where can v use this
|
|
|
|
|
Hi there,
How do you use the inline code <% ... %> with the select element? You might want to post relevant code, also like some one said why don't just use the DropDownList server control instead.
|
|
|
|