Object Must Implement IConvertible. Error After Opening Database.
Dec 6, 2003
Hi,
I am trying to call a stored procedure to insert into my database. After I called Open(), it crashed on ExecuteNonQuery(). I get the following message.
Object must implement IConvertible.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Object must implement IConvertible.
Source Error:
Line 160:Try
Line 161:myConnection.Open()
Line 162:myCommand.ExecuteNonQuery()
Line 163:myConnection.Close()
What does this mean? If anyone encountered this error before, please let me know how to trace the error and fix it.
Thanks Gurus,
John
View 4 Replies
ADVERTISEMENT
Feb 8, 2006
using (SqlConnection oConn = new SqlConnection(sConnection))
using (SqlCommand oCommand =
this.CreateSqlCommand("rcsp_employee_f_changerole.xml", oConn))
{
try { oConn.Open(); }
catch(Exception ex)
{
p_nErrorCode =
10;
p_sErrorMessage = "Error opening database connection during
RCEmployee.DBUpdate: " + ex.Message;
goto Failed;
}
oCommand.Parameters["@employeeid"].Value = p_gID;
oCommand.Parameters["@authorityid"].Value = p_gAuthorityID;
oCommand.Parameters["@role"].Value=sNewRole;
if (!ProcessNonQuery(oCommand,
sMethodName)) goto Failed;
Failed:
if (ErrorCode > 0) bReturn =
false;
oConn.Close();
}
}
return bReturn;
p_gID, p_gAuthorityID is of type guid.
sNewRole is of type string.
I get the error " Object must implement IConvertible at
oCommand.ExecuteNonQuery(); whihch is in the function if (!ProcessNonQuery(oCommand, sMethodName))
View 1 Replies
View Related
Oct 16, 2006
Using: VB.Net 2003, SQL Server 2000 and nText Column...
Examples: "Writing BLOB Values to a Database [Visual Basic]" and "Conserving Resources When Writing BLOB Values to SQL Server [Visual Basic]"
I modified the following code from the samples that were available in Help and MSDN. When my application reaches the ExecuteNonQuery statement it informs me that the Byte Array oDocument must implement IConvertible. I have even tried the extended version which uses a SQL Insert followed by UPDATETEXT with Pointers, and I get the same result with the Byte Array used in that example. My goal is to have Users Append certain documents to Proposals within my database, as I understand that is what I would be doing anyway if I used SharePoint.
Following the examples I have not trouble whatsoever reading an Image File from SQL Server 2000, and therefore I expect no trouble with nText Fields. I just cannot seem to insert Documents or Images via VB Code.
What is wrong with the examples that I cannot use the same code?
---- VB Code Follows ----
Private Sub btnSelectFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectFile.Click
Dim oSQLConnection As System.Data.SqlClient.SqlConnection
Dim oSQLCommand As System.Data.SqlClient.SqlCommand
Dim oSQLDataReader As System.Data.SqlClient.SqlDataReader
Dim oDocument() As Byte
Try
'Define the Initial Directory to be the "My Documents" Directory.
ofdAttachment.InitialDirectory = "My Documents"
'Filter for File of Word, PDF, and Text. This will suffice for now.
ofdAttachment.Filter = "Word Documents (*.doc)|*.doc|PDFs (*.pdf)|*.pdf|Text Files (*.txt)|*.txt"
'Show the Dialog to Open a File.
ofdAttachment.ShowDialog()
'If the User Selected a File then attempt to Add the Attachment.
If ofdAttachment.FileName <> String.Empty Then
'Read the Document into a Byte Array.
oDocument = GetDocumentInBytes(ofdAttachment.FileName)
'Define the Connection to the SQL Database.
oSQLConnection = New System.Data.SqlClient.SqlConnection("Persist Security Info=False;Integrated Security=SSPI;database=proposal_tracking;server=dbserverdbserver;")
'Attempt to Open the SQL Connection.
oSQLConnection.Open()
'Create a New SQL Command Object.
oSQLCommand = New System.Data.SqlClient.SqlCommand
'Assign the SQL Connection information to the SQL Command Object.
oSQLCommand.Connection = oSQLConnection
'Define the SQL Statement to Attach the Document.
oSQLCommand.CommandText = "INSERT INTO Documents (DocumentName, Document) VALUES (@DocumentName, @Document)"
oSQLCommand.CommandType = CommandType.Text
'Define the Parameters of the SQL Statement.
oSQLCommand.Parameters.Add("@DocumentName", SqlDbType.VarChar).Value = Mid(ofdAttachment.FileName, ofdAttachment.FileName.LastIndexOf("") + 2)
oSQLCommand.Parameters.Add("@Document", SqlDbType.NText, oDocument.Length).Value = oDocument
'Execut the SQL Statement. Resulting in an Error that states:
'Object must implement IConvertible.
oSQLCommand.ExecuteNonQuery()
If Not oSQLCommand Is Nothing Then
oSQLCommand.Dispose()
oSQLCommand = Nothing
End If
If Not oSQLConnection Is Nothing Then
oSQLConnection.Close()
oSQLConnection = Nothing
End If
End If
Catch sqlex As System.Data.SqlClient.SqlException
MsgBox(sqlex.Message)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Public Shared Function GetDocumentInBytes(ByVal strFilePath As String) As Byte()
Dim ofsDocumentReader As System.IO.FileStream = New System.IO.FileStream(strFilePath, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim obrDocumentReader As System.IO.BinaryReader = New System.IO.BinaryReader(ofsDocumentReader)
Dim oDocument() As Byte
Try
oDocument = obrDocumentReader.ReadBytes(CInt(ofsDocumentReader.Length))
obrDocumentReader.Close()
ofsDocumentReader.Close()
Return oDocument
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
View 1 Replies
View Related
Aug 9, 2006
i try to do a simple insert using SQLDataSource and a Stored Procedure
I try all night and always have this error
Object Must Implement IConvertible
I can’t understand where I wrong..
Looking around I understand is maybe a typecasting problema but I not find nothing more understeable..
Could someone tell me why Microsoft release this SQLdatasorce making more difficult a simple insert?
If someone could help me to fix this problem please
Here is the code
------------------------------------------------------------------------------------------------------------
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Try
SqlDataSource1.Insert()
Catch ex As Exception
Response.Write(ex.ToString)
Finally
SqlDataSource1.Dispose()
End Try
End Sub
------------------------------------------------------------------------------------------------------------
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CommerceTemplate %>"
InsertCommandType="StoredProcedure" InsertCommand="dbo.StoredProcedure1">
<InsertParameters>
<asp:ControlParameter ControlID="DropDownListCategory" Name="@CategoryID" PropertyName="SelectedValue"
Type="Int32" />
<asp:ControlParameter ControlID="DropDownListCategory" Name="@ModelNumber" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="txtModelName" Name="@ModelName" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="txtProductImage" Name="@ProductImage" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="txtUnitCost" Name="@UnitCost" PropertyName="Text"
Type="Decimal" />
<asp:ControlParameter ControlID="txtDescription" Name="@Description" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="txtWeight" Name="@Weight" PropertyName="Text" Type="Decimal" />
<asp:ControlParameter ControlID="txtDiscount" Name="@Discount" PropertyName="Text"
Type="Decimal" />
<asp:ControlParameter ControlID="chkIsActive" Name="@isActive" PropertyName="Checked"
Type="Boolean" />
<asp:ControlParameter ControlID="DropDownListAuthors" Name="@IDAuthor" PropertyName="SelectedItem"
Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
------------------------------------------------------------------------------------------------------------
ALTER PROCEDURE dbo.StoredProcedure1
@CategoryID int,
@ModelNumber nvarchar(50),
@ModelName nvarchar(50),
@ProductImage nvarchar(50),
@UnitCost money,
@Description varchar(500),
@weight money,
@IsActive bit,
@DiscountPerCent int,
@IDAuthor int
AS
INSERT INTO dbo.CMRC_Products (
CategoryID,
ModelNumber,
ModelName,
ProductImage,
UnitCost,
Description,
weight,
IsActive,
DiscountPerCent,
IDAuthor
)
VALUES (
@CategoryID,
@ModelNumber,
@ModelName,
@ProductImage,
@UnitCost,
@Description,
@weight,
@IsActive,
@DiscountPerCent,
@IDAuthor
)
SELECT @@IDENTITY as [NewID]
------------
View 4 Replies
View Related
Apr 6, 2008
still having problems... here is my code.. (NOTE: I have no code in my .aspx.cs ...maybe that is my problem)
<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage2.master" AutoEventWireup="true" CodeFile="dUsers.aspx.cs" Inherits="Admin_dUsers" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" DataSourceID="SqlDataSource1" DataKeyNames="UserId" AutoGenerateDeleteButton="True" >
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
SelectCommand="SELECT UserId, First, Last, Email, CreateDate, LastLoginDate, IsApproved, IsLockedOut FROM aspnet_Membership"
DeleteCommand="DELETE FROM aspnet_Membership WHERE [UserId] = @UserId"
ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" >
<DeleteParameters>
<asp:Parameter Name="UserId" Type="Int32"/>
</DeleteParameters>
</asp:SqlDataSource>
</asp:Content>
-------------------------------------------------------------
when i click the delete button... this error appears..
-------------------------------------------------------------
Server Error in '/mapuaResearch' Application.
Object must implement IConvertible.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Object must implement IConvertible.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[InvalidCastException: Object must implement IConvertible.]
System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +2514354
System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +257
System.Web.UI.WebControls.SqlDataSourceView.AddParameters(DbCommand command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatString) +657
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +529
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +176
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +912
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +1067
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +215
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3839
* i think i hav to have a code in my c# side.. but i have no idea how to do it.. can someone please help me!!! i really need it.. tnx a lot...
View 1 Replies
View Related
Dec 1, 2005
I've been playing around with the new data controls (DetailsView,FormView) and have been having problems when attempting to update a record that has a uniqueidentifier as its primary key.I get the error message:
Object must implement IConvertible. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Object must implement IConvertible.I gather this is because there is a bug that has propagated from the beta version.One suggested work around is from http://64.233.183.104/search?q=cache:GDjA62POtgcJ:scottonwriting.net/sowBlog/archive/11162005.aspx+Implicit+conversion+from+data+type+sql_variant+to+uniqueidentifier+is+not+allowed.+Use+the+CONVERT+function+to+run+this+query.&hl=en
The crux of the problem, it appears, is that the <asp:Parameter> value for the uniqueidentifier field is, by default, set to Type=�Object�. To fix this, simply remove the Type property altogether. That is, change the SqlDataSource parameter setting from something like:
<asp:SqlDataSource ...> <InsertParameters> <asp:Parameter Name=�UserId� Type=�Object� /> ... </InsertParameters></asp:SqlDataSource>
to:
<asp:SqlDataSource ...> <InsertParameters> <asp:Parameter Name=�UserId� /> ... </InsertParameters></asp:SqlDataSource>
This change worked for me; once the Type was removed the exception ceased and the updates/inserts worked as expected.Unfortunately this only partially worked for me as while it is fine for deletes it won't work for updates.If anyone can help shed any light on this I would greatly appreciate it.CheersMark
View 28 Replies
View Related
Mar 14, 2014
I have a SSIS package where im importing data from MS access database file .MDB. I chose Microsoft JET 4.0 OLEDB provider. When i select a table and preview the data, im getting the below error.
Error at Data Flow Task [OLE DB Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E09.
Error at Data Flow Task [OLE DB Source [1]]: Opening a rowset for "_tblDateDateEarnedMismatch" failed. Check that the object exists in the database.
But it is working for the other tables .
View 3 Replies
View Related
Dec 28, 2007
Hi Guyz
it is taken from SQL2K5 SP2 readme.txt. Anyone have idea what to do to implement this ?
Our sp2 is failing. we suspect the above problem and researching it.we are running on default instance of SQL2K5 on win2003 ent sp2
"When you apply SP2, Setup upgrades system databases. If you have implemented restrictions on the ALTER DATABASE syntax, this upgrade may fail. Restrictions to ALTER DATABASE may include the following:
Explicitly denying the ALTER DATABASE statement.
A data definition language (DDL) trigger on ALTER DATABASE that rolls back the transaction containing the ALTER DATABASE statement.
If you have restrictions on ALTER DATABASE, and Setup fails to upgrade system databases to SP2, you must disable these restrictions and then re-run Setup."
thanks in advance.
View 4 Replies
View Related
Dec 17, 2007
Does any one has any clue for this error ? I did went through a lot of articles on this error but none helped . I am working in Visual studie 2005 and trying to upload image in sql database through a simple form. Here is the code
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.IO;
public partial class Binary_frmUpload : System.Web.UI.Page
{protected void Page_Load(object sender, EventArgs e)
{
}protected void btnUpload_Click(object sender, EventArgs e)
{if (FileUpload.HasFile == false)
{
// No file uploaded!lblUploadDetails.Text = "Please first select a file to upload...";
}
else
{string str1 = FileUpload.PostedFile.FileName;
string str2 = FileUpload.PostedFile.ContentType; string connectionString = WebConfigurationManager.ConnectionStrings["GSGA"].ConnectionString;
//Initialize SQL Server Connection SqlConnection con = new SqlConnection(connectionString);
//Set insert query string qry = "insert into Officers (Picture,PictureType ,PicttureTitle) values(@ImageData, @PictureType, @PictureTitle)";
//Initialize SqlCommand object for insert. SqlCommand cmd = new SqlCommand(qry, con);
//We are passing Original Image Path and Image byte data as sql parameters. cmd.Parameters.Add(new SqlParameter("@PictureTitle", str1));
cmd.Parameters.Add(new SqlParameter("@PictureType", str2));Stream imgStream = FileUpload.PostedFile.InputStream;
int imgLen = FileUpload.PostedFile.ContentLength;byte[] ImageBytes = new byte[imgLen]; cmd.Parameters.Add(new SqlParameter("@ImageData", ImageBytes));
//Open connection and execute insert query.
con.Open();
cmd.ExecuteNonQuery();
con.Close(); //Close form and return to list or images.
}
}
}
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 32:
Line 33: string str2 = FileUpload.PostedFile.ContentType;
Line 34: string connectionString = WebConfigurationManager.ConnectionStrings["GSGA"].ConnectionString;
Line 35:
Line 36: //Initialize SQL Server Connection Source File: c:UsersManojDocumentsVisual Studio 2005WebSitesGSGABinaryfrmUpload.aspx.cs Line: 34
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Binary_frmUpload.btnUpload_Click(Object sender, EventArgs e) in c:UsersManojDocumentsVisual Studio 2005WebSitesGSGABinaryfrmUpload.aspx.cs:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
View 2 Replies
View Related
Jan 4, 2007
Hi, I am a beginner in ASP.NET 2.0
I am creating a simple blog website.
I am using a DataReader object to collect all of the entries in the database (in one full sweep) and then display them by adding rows to a table and populating them.
I would like to enable paging so that only 5 blog entries at a time are displayed. The user should be able to page backwards and forwards 5 at a time.
Please can somebody give me some ideas of how I should do this?
Should I read all of the data into some kind of list so that all of the data is then readily available? An arraylist or something?
I realise that the DataReader object reads in one continuous stream so I couldn't expect it to read backwards and forwards from the database.
I include a portion of my code below which reads the database.
Many thanks.
Dim objCommand As New SqlCommand objCommand.Connection = objConnection objConnection.Open() objCommand.CommandText = "SELECT BlogID, Date, Blog FROM BlogSite2_Blogs ORDER BY Date DESC"
Dim objReader As SqlDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
Dim dateDateTime As Date Dim strBlogEntry As String Dim intBlogID As Integer
Do While objReader.Read() intBlogID = objReader.GetValue(0) dateDateTime = objReader.GetDateTime(1) strBlogEntry = objReader.GetString(2)
CreateBlogRow(intBlogID, dateDateTime, strBlogEntry) Loop
objReader.Close()
View 3 Replies
View Related
Oct 18, 2006
Hi,
I'm new to SQL database.
When I add a new item to project in VS2005: Project-->Add New Item --> Sql Database I got a error msg "object reference not set to an instance of an object" after click "Add" button. The SQL Server Express is running. How do I fix this problem?
Any help would be appreceiated.
CO22006
View 4 Replies
View Related
Jul 11, 2005
Hi,I am getting this error when i am connecting sql database.Error = "SQL Server does not exist or access denied."Can you please suggest me where i am going wrong.RegardsNaveen
View 2 Replies
View Related
Nov 26, 2006
I am trying to deploy my mobile app to treo 700wx, but when i test the app, the application gives me an error message:
sql mobile encountered problems when opening the database
It happens when I sync data.
However, when I sync data users and customer info, it doesn't give this message, But when I sync (third time) order info, this message comes out.
--when i run on my PPC (HP ra1950), there is no this error message.
I think it is a bug?
BTW, which cabs file should I install on the Treo phone? (.Net ce, sql ce mobile30 ???)
Please help me out. Thanks
James
View 3 Replies
View Related
May 13, 2008
Using the following code we are having a problem connecting a clients WIndows Mobile device to the SDF under IIS. We have success elsewhere. Does anyone have any clues ?
Cheers Al
Dim repl As New SqlCeReplication()
Try
repl.InternetUrl = InternetUrl
repl.Publisher = Repl_Publisher
repl.PublisherDatabase = Repl_PublisherDatabase
repl.PublisherSecurityMode = SecurityType.DBAuthentication
repl.Publication = Repl_Publication
repl.Subscriber = Repl_Subscriber
repl.SubscriberConnectionString = Repl_SubscriberConnectionString
repl.DistributorLogin = Handhelds_User
repl.DistributorPassword = Handhelds_Password
repl.AddSubscription(AddOption.ExistingDatabase)
repl.Synchronize()
MsgBox("Synched!")
Catch err As SqlCeException
MessageBox.Show(err.ToString, "Error")
Finally
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
End Try
View 3 Replies
View Related
Mar 27, 2006
I have created a sql login account called "webuser" and has given public role in my database. In my asp.net application i build connection string using above account and its password . We give permission on store procedure for for the above account to execute .We dont give table level permission for the above account . When we run the application with the above settings it runs fine on test server . However Now i have transfered the databse object to live server with its permissions . Now while I executing the aspx page , I am getting above error . I have checked that the store procedure has execute permission for webuser account and dbo(i.e SA) has all the permissions for all database objects . Still why i am getting error ? (Please note , the thing is working fine in test server)
Pl help
Regards
View 4 Replies
View Related
Dec 12, 2007
Is there a query I can run in a DB where I can search for object names that will tell me where or what it is? Trigger Name? Table Name? Constraint Name? Index NAme? or whatever?
Thanks
View 4 Replies
View Related
Feb 11, 2005
I've got code that on my own machine (visual studio .net 2003 and iis and sql server all exist on this box) works great. I display my test page, which loads a dropdownlist on page_load. This works great on my own machine.
When I move the code to our dev environment. Web server and database servers on separate boxes. I get the error "Object reference not set to an instance of an object" when i try to open the connection to the database. I thought it had to do with permissions and I check all through sql server and everything looks great. I then thought it was the connection string. I still haven't ruled this out, but I wrote a quick vbscript app to attach to the database and try to pull a record. The vbscript worked fine. So, the code works fine on my computer, but not on the web server. The connection does work with vbscript, but through my asp.net web app I get the "object reference" error.
All code below...
ASP.NET webpage:
private void Page_Load(object sender, System.EventArgs e)
{
if( !IsPostBack )
{
// Create a command object for the query
string mySelectQuery = "select id from vw_abcd order by ID";
SqlCommand myCommand = new SqlCommand(mySelectQuery,sqlConnection1);
sqlConnection1.Open();
DropDownList1.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
DropDownList1.DataBind();
sqlConnection1.Close();
RangeValidator1.MinimumValue = "1";
RangeValidator1.MaximumValue = DropDownList1.Items.Count.ToString();
}
}
Connection string on my machine:
workstation id=wXXXXXX01;packet size=4096;user id=testuser;password=testpass;integrated security=SSPI;data source=wXXXXXX01;persist security info=False;initial catalog=TestDB"/>
Connection string on web server:
network library=DBMSSOCN;data source=xxx.xx.xxx.xxxinstance1;user id=testuser;password=testpass;initial catalog=TestDB
vbscript:
Dim connConnection, rstresultset
strConnectionString = "driver={Sql Server};server=xxx.xx.xxx.xxxinstance1;user id=testuser;password=testpass;database=TestDB"
Set connConnection = CreateObject("ADODB.Connection")
connConnection.Open strConnectionString
Set rstresultset = createobject("ADODB.Recordset")
rstresultset.ActiveConnection = connConnection
rstresultset.Open "select id, comment from testtable", connConnection
msgbox rstresultset(0)
msgbox rstresultset.Fields(0).Value
Error message and stack trace:
Object reference not set to an instance of an object.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at Web2.Drilldown.Page_Load(object sender, System.EventArgs e)
Any ideas what's going on?????
View 1 Replies
View Related
Nov 26, 2007
I just installed the latest VS 2008 C# Express and SSCE 3.5. I am trying to test the "LINQ to SQL" feature. I added a data connection to Nortwind.sdf, selected "Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5)" as data provider, tested the connection, and get the following error when I drag and drop the "Customers" table on the design surface "The selected object(s) use an unsupported database provider" ?. I can create new tables and view existing tables etc. except droppinjg it on the design surface. What am I doing wrong?
The installation on my WindowsXP machine went without a hitch.
Sam
View 10 Replies
View Related
Sep 27, 2007
Hi,
I granted all the rights on the database to the user (db_owner, public, db_datawriter, etc...) However, I didn't grant the "System Administrators" role. I also specifically granted the select on those tables (sysobjects and sysindexes) for the user and checked through ‘sp_helprotect sysobjects’ command whether there are no specific revokes for for that user.
However, the user is still getting the below error while trying to expand the "Tables" view in the Enterprise Manager.
ERROR 229: SELECT permission denied on object 'sysobjects', database 'My_test', owner 'dbo', SELECT permission denied on object 'sysindexes', database 'My_test', owner 'dbo'.
Also, the user claims that he can’t seem to do anything with the database, he can’t view any objects, and, when he goes to Query Analyzer, if he tries to run a SELECT query on a table (that he know that this table exists), he gets this error:
SELECT permission denied on object 'tblBillingTrans', database 'My_Test', owner 'dbo'.
Any help would be greatly appreciated!
Thanks,
Alla
View 7 Replies
View Related
Aug 17, 2007
Hello All
Not sure if this is the right forum to post this question to, so if it's not, please accept my apologies.
I'm working in SQL Server 2005 with a database that was migrated to 2005 from SQL Server 2000. I have to alter a trigger on a table for some functionality changes, and when I modify the trigger and then access it through the application the database is working with, I receive this error:
There was a error in the [stored procedure name] procedure. Error Number: -2147217900 Error Description: [Microsoft][ODBC SQL Server Driver][SQL Server]The definition of object '[trigger name]' has changed since it was compiled.
[stored procedure name] and [trigger name] are where the actual names appear in the message.
I've tried running sp_recompile on the trigger, stored procedure, and table that are associated with this, and nothing works. I have dropped the trigger, which allows the save process to complete (but doesn't perform the required functionality, of course), and then re-created the trigger, but the error message still comes up. The compatibility level for the database is SQL Server 2000 (80) (as it was migrated from SQL Server 2000 as I mentioned above).
Has anyone seen this, and if so, how can I fix it?
Thanks in advance for your help!
Jay
View 4 Replies
View Related
Dec 21, 2006
Help! I have posted this before and I had hoped that the VS2005 SP1 would help my problem. It didn't. My code is shown below. I have dropped a sqlconnection, sqldataadapter and a strongly-typed dataset from the toolbox onto the component designer for my page and written my code. It compiles without any errors but at runtine I receive the system error "Object reference not set to an instance of an object." The error occurs at the first line where the sqldataadapter is mentioned. I have shufflled the code and the error still occurs at first mention of the dataadapter. I have set parameters to a simple string such as "myemail." It hasn't helped. I have used the "Dim" statement as "Dim DaAuthorLogin as System.Data.SqlClient.SqlDataadapter and Dim DaAuthorLogin as New ......) at the start of the private sub generated by the event requiring the data. Nothing helps. Here is my simple code to select data from a sqlserver 2000 database. Why do I continue to get this error?
Partial Class AuthorLogin
Inherits System.Web.UI.Page
Protected WithEvents AuthorInformation As System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.DaAuthorLogin = New System.Data.SqlClient.SqlDataAdapter
Me.MDData = New System.Data.SqlClient.SqlConnection
Me.DsAuthorLogin = New MedicalDecisions.DsAuthorLogin
CType(Me.DsAuthorLogin, System.ComponentModel.ISupportInitialize).BeginInit()
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT AuthorAlias, AuthorEmail, AuthorPassword, LastName, PreferredName" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FRO" & _
"M T_Author" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "WHERE (AuthorEmail = @AuthorEmail) AND (AuthorPassword =" & _
" @AuthorPassword)"
Me.SqlSelectCommand1.Connection = Me.MDData
Me.SqlSelectCommand1.Parameters.AddRange(New System.Data.SqlClient.SqlParameter() {New System.Data.SqlClient.SqlParameter("@AuthorEmail", System.Data.SqlDbType.NVarChar, 50, "AuthorEmail"), New System.Data.SqlClient.SqlParameter("@AuthorPassword", System.Data.SqlDbType.NVarChar, 50, "AuthorPassword")})
'
'DaAuthorLogin
'
Me.DaAuthorLogin.SelectCommand = Me.SqlSelectCommand1
Me.DaAuthorLogin.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "T_Author", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("AuthorAlias", "AuthorAlias"), New System.Data.Common.DataColumnMapping("AuthorEmail", "AuthorEmail"), New System.Data.Common.DataColumnMapping("AuthorPassword", "AuthorPassword"), New System.Data.Common.DataColumnMapping("LastName", "LastName"), New System.Data.Common.DataColumnMapping("PreferredName", "PreferredName")})})
'
'MDData
'
Me.MDData.ConnectionString = "Data Source=CIS1022DAVID;Initial Catalog=CGData;Integrated Security=True;Pooling" & _
"=False"
Me.MDData.FireInfoMessageEventOnUserErrors = False
'
'DsAuthorLogin
'
Me.DsAuthorLogin.DataSetName = "DsAuthorLogin"
Me.DsAuthorLogin.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
CType(Me.DsAuthorLogin, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents MDData As System.Data.SqlClient.SqlConnection
Friend WithEvents DaAuthorLogin As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents DsAuthorLogin As MedicalDecisions.DsAuthorLogin
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs)
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
'no code here
End Sub
Private Sub AuthorLoginRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AuthorLoginRegister.Click
'for new author registration
Response.Redirect("AuthorInformation.aspx")
End Sub
Private Sub AuthorLoginBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AuthorLoginBack.Click
'to navigate back
Response.Redirect("MainPaths.aspx")
End Sub
Protected Sub AuthorLoginPassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AuthorLoginPassword.TextChanged
'pass the parameters to the dataadapter and return dataset
DaAuthorLogin.SelectCommand.Parameters("@AuthorEmail").Value = AuthorLoginEmail.Text
DaAuthorLogin.SelectCommand.Parameters("@AuthorPassword").Value = AuthorLoginPassword.Text
MDData.Open()
DaAuthorLogin.Fill(DsAuthorLogin, "T_Author")
MDData.Close()
'set session objects
If DsAuthorLogin.T_Author.Rows.Count > 0 Then
Session("AuthorAlias") = DsAuthorLogin.T_Author(0).AuthorAlias
Session("LastName") = DsAuthorLogin.T_Author(0).LastName
Session("PreferredName") = DsAuthorLogin.T_Author(0).PreferredName
Response.Redirect("AuthorPaths.aspx")
Else : AuthorLoginNotValid.Visible = True
AuthorLoginEmail.Text = ""
AuthorLoginPassword.Text = ""
End If
End Sub
End Class
Thanks in advance,
David
View 2 Replies
View Related
Sep 12, 2006
Anyone know what this error means and how to get rid of it?
Public Sub Main()
Dim myMessage As Net.Mail.MailMessage
Dim mySmtpClient As Net.Mail.SmtpClient
myMessage.To(20) = New Net.Mail.MailAddress(me@hotmail.com)
myMessage.From = New Net.Mail.MailAddress(someone@microsoft.com)
myMessage.Subject = "as;dlfjsdf"
myMessage.Priority = Net.Mail.MailPriority.High
mySmtpClient = New Net.Mail.SmtpClient("microsoft.com")
mySmtpClient.Send(myMessage)
Dts.TaskResult = Dts.Results.Success
End Sub
Thanks,
View 4 Replies
View Related
Mar 17, 2008
Hi,
I am trying to develop a custom algorithm. I have implemented and tested training methods, however I fail at prediction phase. When I try to run a prediction query against a model created with my algorithm I get:
Executing the query ...
Obtained object of type: Microsoft.AnalysisServices.AdomdClient.AdomdDataReader
COM error: COM error: DMPluginWrapper; Object reference not set to an instance of an object..
Execution complete
I know this is not very descriptive, but I have seen that algorith doesn't even executes my Predict(..) function (I can test this by logging to a text file)
So the problem is this, when I run prediction query DMPluginWrapper gives exception -I think- even before calling my custom method.
As I said it is not a very descriptive message but I hope I have hit a general issue.
Thanks...
View 3 Replies
View Related
May 22, 2008
Just installed VS 2005 & SQLServer 2005 clients on my workstation. When trying to create a new Integration Services Project and start work in the designer receive the MICROSOFT VISUAL STUDIO 'Object reference not set to an instance of an object.' dialog box with message "Creating project 'Integration Services project1'...project creation failed."
Previously I had SQLServer 2000 client with the little VS tool that came with it installed. Uninstalled these prior to installing the 2005 tools (VS and SQLServer).
I'm not finding any information on corrective action for this error.
Any one have this problem and found the solution?
Thanks,
CLC
View 1 Replies
View Related
Sep 13, 2006
I am trying to execute this code feom Script task while excuting its giving me error that "Object reference not set to an instance of an object." The assemblies Iam referening in this code are there in GAC. Any idea abt this.
Thanks,
Public Sub Main()
Dim remoteUri As String
Dim fireAgain As Boolean
Dim uriVarName As String
Dim fileVarName As String
Dim httpConnection As Microsoft.SqlServer.Dts.Runtime.HttpClientConnection
Dim emptyBytes(0) As Byte
Dim SessionID As String
Dim CusAuth As CustomAuth
Try
' Determine the correct variables to read for URI and filename
uriVarName = "vsReportUri"
fileVarName = "vsReportDownloadFilename"
' create SessionID for use with HD Custom authentication
CusAuth = New CustomAuth(ASCIIEncoding.ASCII.GetBytes(Dts.Variables("in_vsBatchKey").Value.ToString()))
Dts.Variables(uriVarName).Value = Dts.Variables(uriVarName).Value.ToString() + "&" + _
"BeginDate=" + Dts.Variables("in_vsBeginDate").Value.ToString() + "&" + _
"EndDate=" + Dts.Variables("in_vsEndDate").Value.ToString()
Dim request As HttpWebRequest = CType(WebRequest.Create(Dts.Variables(uriVarName).Value.ToString()), HttpWebRequest)
'Set credentials based on the credentials found in the variables
request.Credentials = New NetworkCredential(Dts.Variables("in_vsReportUsername").Value.ToString(), _
Dts.Variables("in_vsReportPassword").Value.ToString(), _
Dts.Variables("in_vsReportDomain").Value.ToString())
'Place the custom authentication session ID in a cookie called BatchSession
request.CookieContainer.Add(New Cookie("BatchSession", CusAuth.GenerateSession("EmailAlertingSSIS"), "/", Dts.Variables("in_vsReportDomain").Value.ToString()))
' Set some reasonable limits on resources used by this request
request.MaximumAutomaticRedirections = 4
request.MaximumResponseHeadersLength = 4
' Prepare to download, write messages indicating download start
Dts.Events.FireInformation(0, String.Empty, String.Format("Downloading '{0}' from '{1}'", _
Dts.Variables(fileVarName).Value.ToString(), Dts.Variables(uriVarName).Value.ToString()), String.Empty, 0, fireAgain)
Dts.Log(String.Format("Downloading '{0}' from '{1}'", Dts.Variables(fileVarName).Value.ToString(), Dts.Variables(uriVarName).Value.ToString()), 0, emptyBytes)
' Download data
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
' Get the stream associated with the response.
Dim receiveStream As Stream = response.GetResponseStream()
' Pipes the stream to a higher level stream reader with the required encoding format.
Dim readStream As New StreamReader(receiveStream, Encoding.UTF8)
Dim fileStream As New StreamWriter(Dts.Variables(fileVarName).Value.ToString())
fileStream.Write(readStream.ReadToEnd())
fileStream.Flush()
fileStream.Close()
readStream.Close()
fileStream.Dispose()
readStream.Dispose()
'Download the file and report success
Dts.TaskResult = Dts.Results.Success
Catch ex As Exception
' post the error message we got back.
Dts.Events.FireError(0, String.Empty, ex.Message, String.Empty, 0)
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
View 1 Replies
View Related
Jan 14, 2008
Hello -
For the life of me I cannot figure out why i'm getting the "Object Refence Not Set To an Instance of An Object" error after I try and create a Report Services project in Business Intelligence Studio. I've followed all of the steps in similar posts such as checking the ReportServer/web.config file but everything checks out.
Does anyone have any other ideas as to how I can get rid of this annoying error and start creating some reports?
Thanks!!!
View 3 Replies
View Related
May 9, 2008
I recently installed SQL Server 2005 Enterprise on a machine running Server 2003. I have successfully configured Reporting Services (see below for summary of settings)
- Used the defaults for the Repor tServer and Report Manager Virtual Directories
- Windows Service Identity set to domain user. The domain user is part of the administrator group on the machine and has sysadmin rights to the database
- Web Service Identity set to NT AuthorityNetworkService
When I open http://localhost/reports/, I get the following error:
I have check a bunch of forums, but have no success. Any advise would be greatly appreciated!!
Server Error in '/Reports' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0016: Could not write to output file 'c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628App_global.asax.th5hkjqv.dll' -- 'The directory name is invalid. '
Source Error:
[No relevant source lines]
Source File: Line: 0
Show Detailed Compiler Output:
c:windowssystem32inetsrv> "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727csc.exe" /t:library /utf8output /R:"C:WINDOWSassemblyGAC_32System.Web2.0.0.0__b03f5f7f11d50a3aSystem.Web.dll" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl3a890e9c0 068591f_f54cc701ReportingServicesFileShareDeliveryProvider.DLL" /R:"C:WINDOWSassemblyGAC_MSILSystem.Web.Mobile2.0.0.0__b03f5f7f11d50a3aSystem.Web.Mobile.dll" /R:"C:WINDOWSassemblyGAC_32System.Data2.0.0.0__b77a5c561934e089System.Data.dll" /R:"C:WINDOWSassemblyGAC_MSILSystem.Web.Services2.0.0.0__b03f5f7f11d50a3aSystem.Web.Services.dll" /R:"C:WINDOWSassemblyGAC_MSILSystem.Configuration2.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll" /R:"C:WINDOWSassemblyGAC_32System.EnterpriseServices2.0.0.0__b03f5f7f11d50a3aSystem.EnterpriseServices.dll" /R:"C:WINDOWSassemblyGAC_MSILSystem.IdentityModel3.0.0.0__b77a5c561934e089System.IdentityModel.dll" /R:"C:WINDOWSassemblyGAC_MSILSystem.ServiceModel3.0.0.0__b77a5c561934e089System.ServiceModel.dll" /R:"C:WINDOWSassemblyGAC_MSILSystem2.0.0.0__b77a5c561934e089System.dll" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl34a099978 068591f_f54cc701ReportingServicesEmailDeliveryProvider.DLL" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727mscorlib.dll" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl3de5a2332 0958a20_f54cc701ReportingServicesWebUserInterface.DLL" /R:"C:WINDOWSassemblyGAC_MSILSystem.Xml2.0.0.0__b77a5c561934e089System.Xml.dll" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl3498aee86 042473c_93d0c501ReportingServicesCDOInterop.DLL" /R:"C:WINDOWSassemblyGAC_MSILSystem.Runtime.Serialization3.0.0.0__b77a5c561934e089System.Runtime.Serialization.dll" /R:"C:WINDOWSassemblyGAC_MSILSystem.Drawing2.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl3cd47089b 0f2a80e_f54cc701Microsoft.ReportingServices.Interfaces.DLL" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl3f180608d 0083daf_b16dc701Microsoft.ReportingServices.Diagnostics.DLL" /R:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628assemblydl323449648 068591f_f54cc701ReportingServicesNativeClient.DLL" /out:"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628App_global.asax.th5hkjqv.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699;1701 "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628App_global.asax.th5hkjqv.0.cs" "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628App_global.asax.th5hkjqv.1.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.1433
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
error CS0016: Could not write to output file 'c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
eports2cbaf422c4330628App_global.asax.th5hkjqv.dll' -- 'The directory name is invalid. '
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
View 5 Replies
View Related
Sep 14, 2007
Yesterday, literally I was banging my head to the wall, kept getting this error:
A Connection could not be established with the information provided. Hit OK to change your connection settings.
Invalid object name 'sysdatabases'.
I uninstall and re-install back the reporting services couple times and I kept getting the same error.
I have 2 instances of SQL Server on the same Server:
SQL Server 2000
SQL Server 2005
The 2 instances work side by side, I was wondering if this causing the error.
Can anyone help out with this problem?
Thanks - John
View 9 Replies
View Related
Sep 27, 2007
There are certain errors that does not come during compilation and it shows during execution because of late-binding concept implemented in SQL Server from 7.0 version.
The problem is when Tables are not there, SPs are created. And there is no option where we can set like 'Validate object resolution during compilation"
There are lot of SPs that are in invalid status because the tables are really not there and SP needs to be modified to reflect the correct table name. In Oracle, if I have to find the list of objects that are in invalid state (because of object resolution problems), it was possible. How do I do it in SQL?
I need a listing of all objects in my database that is in invalid state. Searched in NET but there seems to be no supporting tool also that lists invalid objects.
Pl let me know whether there exists a way by which I can get to know the invalid object lists in my SQL 2005 database
View 2 Replies
View Related
Jun 4, 2015
I'm currently learning how to implement Encryption into my SQL database, and I've run into something I don't know how to explain or understand. I'm working on creating a set encryption for a set of columns in a database, and I don't know how to figure out what size the VARBINARY column needs to be. After some trial and error, I've noticed that a clear text of 9 characters needs 68 varbinary characters, 100 cleartext=148 varbinary, and 254 cleartext= 308 varbinary characters. How is the minimum number of varbinary characters calculated?Â
View 2 Replies
View Related
Dec 28, 2004
Each time I press submit to insert data into the database I receive the following message. I use the same code on another page and it works fine. Here is the error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 125: MyCommand.Parameters("@Balance").Value = txtBalance.Text
Line 126:
Line 127: MyCommand.Connection.Open()
Line 128:
Line 129: Try
Source File: c:inetpubwwwrootCreditRepairCreditor_Default.aspx.vb Line: 127
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
CreditRepair.CreditRepair.Vb.Creditor_Default.btnSaveAdd_Click(Object sender, EventArgs e) in c:inetpubwwwrootCreditRepairCreditor_Default.aspx.vb:127
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
If (Page.IsValid) Then
Dim DS As DataSet
Dim MyCommand As SqlCommand
Dim AddAccount As String = "insert into AccountDetails (Account_ID, Report_ID, Balance) values (@Account_ID, @Report_ID, @Balance)"
MyCommand = New SqlCommand(AddAccount, MyConnection)
MyCommand.Parameters.Add(New SqlParameter("@Account_ID", SqlDbType.Char, 50))
MyCommand.Parameters("@Account_ID").Value = txtAccount_ID.Text
MyCommand.Parameters.Add(New SqlParameter("@Report_ID", SqlDbType.Char, 50))
MyCommand.Parameters("@Report_ID").Value = txtReport_ID.Text
MyCommand.Parameters.Add(New SqlParameter("@Balance", SqlDbType.Char, 50))
MyCommand.Parameters("@Balance").Value = txtBalance.Text
MyCommand.Connection.Open()
MyCommand.ExecuteNonQuery()
Response.Redirect("Customer_Details.aspx?SS='CustHeadGrid.Columns[0].Item.lblSS.Text)")
MyCommand.Connection.Close()
End If
View 2 Replies
View Related
Mar 19, 2008
Hi,
When I am trying to drop a user using following statement
--First remove access from all databases
Set @SQL =
'
USE [?];
if ''' + @login_name + ''' in (Select name from sysusers )
EXEC [?].dbo.sp_revokedbaccess @name_in_db = N''' + @login_name + ''';
'
Exec sp_msforeachdb @SQL
Print 'Access Removed.'
exec @ret_value=master.dbo.sp_droplogin @login_name
I am getting an error,
User has been dropped from current database.
User has been dropped from current database.
Access Removed.
No permission to access database 'model'.
Server: Msg 229, Level 14, State 5, Line 1
SELECT permission denied on object 'sysjobs', database 'msdb', owner 'dbo'.
Login dropped.
The SQL Version I am using is
-------------------------------------------
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
Please help me to solve this issue.
Mujeeb.
View 5 Replies
View Related