|
hmmm once i have faced the similar situation while updating records; that there was no error or exception but database is not updated..
try the following inside the button click event:
if(!page.IsPostBack)
{
AccessSource1.UpdateParamters.Add("NoActive","yes");
AccessSource1.UpdateParamters.Add("EmployeeID",DropDownList1.SelectedValue);
}
$@N@
|
|
|
|
|
Hi
I am trying to add a childnode to a treeview in visual basic, but I am able to do so. Can someone give me an example how to do this, please? Below is my method in which I add my parent nodes:
Private Sub PopulateNodes(ByVal dt As DataTable, ByVal nodes As TreeNodeCollection)
Dim var As String
For Each r As DataRow In dt.Rows
Dim tn As New TreeNode()
If r("Active").ToString = "YES" Then
tn.Text = r("LastName").ToString()
tn.Value = r("EmployeeID").ToString()
tn.ImageUrl = ("~/word.png")
ElseIf r("Active").ToString Is Nothing Then
THIS IS WHERE I NEED TO ADD A CHILD NODE
Else
tn.Text = r("LastName").ToString()
tn.Value = r("EmployeeID").ToString()
tn.ImageUrl = ("~/has_store_basic.png")
var = Server.UrlEncode(r("LastName").ToString())
tn.NavigateUrl = ("Results.aspx?Value=" & var)
End If
nodes.Add(tn)
End Sub
|
|
|
|
|
Any Help will do!!!
I am using this code to display an image from a sql server to an asp.net page:
dr.Read();
{
Response.ContentType = "image/Jpeg";
Response.Expires = 0;
Response.Buffer = true;
Response.Clear();
Response.BinaryWrite((byte[])dr["FileData"]);
Response.End();
}
And all I see is this on the page : System.Web.HttpPostedFile
Please help me!!!
|
|
|
|
|
This might be a completely stupid question, but do you actually have an image in the database, or just a series of bytes that translates to the string "System.Web.HttpPostedFile"
|
|
|
|
|
Or is it possible that the image may have not been saved in the database correctly?
Be careful, there is no Undo Button(Ctrl+Z) in life.
|
|
|
|
|
crudeCodeYogi wrote: Or is it possible that the image may have not been saved in the database correctly?
That's what I was implying.
|
|
|
|
|
well in the 2005 sql db the field type is image and when I open the table I field reads BinaryData, does that mean the image is corrupted.
|
|
|
|
|
Anita_Kamat_inds wrote: well in the 2005 sql db the field type is image
image is deprecated, use varbinary(max) instead.
Anita_Kamat_inds wrote: when I open the table I field reads BinaryData, does that mean the image is corrupted
No, I'm suggesting you never put the image in there correctly in the first place.
|
|
|
|
|
OK, Will try changing the field type, and see what happens. Thanks Man.
|
|
|
|
|
Going by what you get back in your application, I suspect it was the input of data from your .NET application that was in error.
|
|
|
|
|
this is the code I am using to insert the image into the db. I think this line of code has en error:
nBytesRead = theStream.Read(Buffer, 0, BUFFER_SIZE);
the BUFFER_SIZE should be the size of the image,not a const. my guess.
const int BUFFER_SIZE = 255;
int nBytesRead = 0;
Byte[] Buffer = new Byte[BUFFER_SIZE];
StringBuilder strUploadedContent = new StringBuilder("");
Stream theStream = uplTheFile.PostedFile.InputStream;
nBytesRead = theStream.Read(Buffer, 0, BUFFER_SIZE);
while (0 != nBytesRead)
{
strUploadedContent.Append(Encoding.ASCII.GetString(Buffer, 0, nBytesRead));
nBytesRead = theStream.Read(Buffer, 0, BUFFER_SIZE);
}
HttpPostedFile UploadPic = uplTheFile.PostedFile;
int UploadPicLength = UploadPic.ContentLength;
byte[] PicArray = new byte[UploadPicLength];
UploadPic.InputStream.Read(PicArray, 0, UploadPicLength);
OleDbConnection conn = new OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings["XXXXXX"].ConnectionString);
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
string strSQL = "Update tbl set FileData= '" + UploadPic + "' WHERE (ID = 'xcv') ";
|
|
|
|
|
I have an actual image saved in the DB
|
|
|
|
|
do you think that msg means that the image is corrupted.
|
|
|
|
|
I have a employee class and manager class derived from it . I want to show the objects/records of both the base
class (employee class) and derived class (manager class) in a single gridview . How can i bind both the base
class n derived class in a gridview ? pls send me a link or code . In addition to this , i want to show the
records of base class and dervied class with different colours on grid ? how can i do that ? pls help , its
urgent !
|
|
|
|
|
dotnet.coder wrote: pls send me a link or code
www.rentacoder.com
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I would like to be able to select absolute positioning for 'Label' controls but whenever I select this control type the 'Position...' item in 'Format' is disabled. Why is it so? Is there a way to select absolute positioning for this type of control? Thanks!
----------------------------------------------------------
this is a sig++
|
|
|
|
|
Hi All,
I am trying to use a autocomplete Ajax tool for a textbox to register search possibilities from the database. For some reason when I load up the application nothing happens. My web method is below and Im not sure if there is anything wrong with it since it does return an array of strings from the datatable.
Would someone be able to assist with this? Many thanks and kind regards.
<br />
using System;<br />
using System.Collections;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
using System.Xml.Linq;<br />
using System.Collections.Generic;<br />
using System.Data;<br />
using System.Configuration;<br />
<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
<br />
using System.Data.SqlClient;<br />
<br />
[WebService(Namespace = "http://hello.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService]<br />
public class WebService : System.Web.Services.WebService {<br />
<br />
public WebService () {<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
[WebMethod]<br />
public string[] GetCountry(string country)<br />
{<br />
<br />
string query = "SELECT COUNTRY FROM CUSTOMERS WHERE COUNTRY LIKE @Country";<br />
using (SqlConnection conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\NORTHWND.MDF;Integrated Security=True;User Instance=True"))
{<br />
<br />
SqlDataAdapter adapter = new SqlDataAdapter(query, conn);<br />
adapter.SelectCommand.Parameters.Add("@Country", SqlDbType.VarChar,15).Value = country + "%";<br />
DataTable dt = new DataTable();<br />
adapter.Fill(dt);<br />
string[] items = new string[dt.Rows.Count];<br />
int i = 0;<br />
foreach (DataRow dr in dt.Rows)<br />
{<br />
items.SetValue(dr["Country"].ToString(), i);<br />
<br />
i++;<br />
}<br />
return items ;<br />
<br />
<br />
<br />
<br />
}<br />
}<br />
|
|
|
|
|
how to open a new window in asp.net using javascript? i should also be able to control its size parameters . and i want to place some controls like textbox in it..
|
|
|
|
|
its a basic question just read javascript window.open function...
umerumerumer
|
|
|
|
|
You can use window.open()[^] javascript method.
window.open ("http://www.codeproject.com","mywindow","location=1,status=1,scrollbars=1,width=100,height=100");
Be careful, there is no Undo Button(Ctrl+Z) in life.
|
|
|
|
|
but i want to keep textboxes and labels in that window and according to values entered in that newly opend window specific event should be fired.
|
|
|
|
|
but i want to keep textboxes and labels in that newly opened window and according to that values entered by the user specific event should be fired
|
|
|
|
|
Is this a dynamic page? If not then you can create an aspx with desired controls and then can call window.open with the newly created page name.
Be careful, there is no Undo Button(Ctrl+Z) in life.
|
|
|
|
|
Hi,
I have a Web Application which referes to COM components for various reasons.
These COM components are built in VB6 and works fine when executed from Windows application from my machine.
This means, COM components are properly registered on my machine. When I gave reference to these from my Web App, respective Interop.<xxxx> DLL are created.
The COM component is the described as - "Microsoft VBUpgrade Tool TypeLib Visual Basic runtime objects and procedures" in VS.NET 2008 reference properties.
Question : I am getting following error when I try to create an object of VBRUN.PropertyBagClass
Error Message : An exception of type System.Runtime.InteropServices.COMException was raised and caught.<br />
Message: Retrieving the COM class factory for component with CLSID {D5DE8D20-5176-4EF2-8581-7B534D2AC56E} failed due to the following error: 80040154.
Stack Trace pointed to the line where object was being created
I searched google and came to a conclusion that I need to give rights of COM component execution for ASPNET account. I tried DCOM Configuration but am not sure to whom give the access rights and of what ?
It would be great if you guys give some sort of pointer to this ? Also wanted to make sure that my conclusion is right ?
Thanks !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hello,
In Microsoft Visual Basic 2005 Express Edition Version 8.0.50727.42 (RTM.050727-4200) and Microsoft .NET Framework Version 2.0.50727.
Right Click Toolbox--Choose Item--.NET Framework Components--Check on OracleConnection and OracleDataAdapter--Ok
Now double click OracleDataAdapter1 in the toolbox.
Data Adapter Configure Wizard appears. Click on New connection.
Add Connection dialoge box appears.
Click on change.
Change Data Source dialogue box appears.
Here i am getting only 2 items:
1.Microsoft Access Database File
2.Microsoft SQL Server Database File
And in Data Provider combo box; only ".Net Framework Data Provider for SQL Server".
I am not able to configure my OracleDataAdapter1 control by choosing above method.
Please help and guide me.
Thanks & Regards
Girish Sharma
|
|
|
|