Show error when I login to the SQL server management. First, I change the server name. Second restart the server/1st stop services the start services. Then I check the server name SELECT @@servername AS 'ServerName' using this line the show new change server name. Then I closed the window of SQL server then open it and type the new change server but show error. Please help me.... I use SQL Server 2008 r2. Windows authentication [Click Here](https://ibb.co/mzL2BdC) SELECT HOST_NAME() AS 'host_name()', @@servername AS 'ServerName\InstanceName', SERVERPROPERTY('servername') AS 'ServerName', SERVERPROPERTY('machinename') AS 'Windows_Name', SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS 'NetBIOS_Name', SERVERPROPERTY('instanceName') AS 'InstanceName', SERVERPROPERTY('IsClustered') AS 'IsClustered' EXEC …

Member Avatar
+0 forum 0

** Cannot open MSSQLSSQLEXPRESS service on computer'.'. ** **What I have tried:** Dim myController As New System.ServiceProcess.ServiceController("SQL Server (SQLEXPRESS)") ------------------------------------------------------------------------------------------------------------ Private Sub Service_status() If myController.Status = ServiceProcess.ServiceControllerStatus.Running Then TextBox1.Text = "Started" ElseIf myController.Status = ServiceProcess.ServiceControllerStatus.Stopped Then TextBox1.Text = "Stopped" End If End Sub ------------------------------------------------------------------------------------------------------------ Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Service_status() End Sub ------------------------------------------------------------------------------------------------------------ Private Sub BtnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStop.Click ProgressBar1.Value = 0 Try myController.Stop() Catch ex As Exception MsgBox(ex.Message) Finally ProgressBar1.Value = 100 myController.WaitForStatus(ServiceProcess.ServiceControllerStatus.Stopped) '//Add Service_status() End Try End Sub ------------------------------------------------------------------------------------------------------------ Private Sub BtnStart_Click(ByVal sender As System.Object, …

Member Avatar
+0 forum 0

Hi, I would like to ask a question about returning the column value(s) returned by stored procedure in c#. I have created the code but somehow I encountered an error saying: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Additional information: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Here is my code public void Display(string pdesc, string psdesc, string psize, string category, ListView lv) { cn.con.Open(); queryString = "execute dbo.sp_RunningBalance @desc, @sdesc, @cat, @size"; …

Member Avatar
Member Avatar
+0 forum 1

automatically duplicate rows in sql server 2008 r2 select query i have two table name 1) tbl_Stock_Journal 2) tbl_Stock_Journal_Details i run a select query with where condition i have 5 data in table1 and in table 2 have 3 data when i run the query result is showing 15 row the query show on date wise i want to maximum data show and if other table in same date have no number of data then show blank or null please help me..... ALter proc P_GetStockJournalRPT -- 'all', 'all','2018-07-10' , '2018-07-10' @SJItmID varchar (100) , @SJDItmID varchar (100) , @Sdate date, …

Member Avatar
Member Avatar
+0 forum 4

hi everyone how can i save a folder path in the sql server database and retrive it again by using vb.net 2010?

Member Avatar
Member Avatar
+0 forum 7

hiii frnds i am work in vb.net windows application now in sql empid field is Unique (primary key) that how can i impliment and handle Empid manually

Member Avatar
Member Avatar
+0 forum 1

i am using asp.net datalist to retrieve text from database field, when i put an integer value like 10 in where clause of select statement then it retrieves data from databse on next page but when i used variable (which is used to store value sent via query string) then it gives me error: CODE: using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class applyForJob : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //string useremail =(string)Session["UserEmail"]; int qryStrng_advId …

Member Avatar
Member Avatar
+0 forum 4

need an insert query for my code , i wrote code to add table rows having textboxes, dynamically, e.g yoh have only passed HSSC exam then you have to fill 2 levels of education SSC, HSSC......or say you have passed Phd , then SSC,HSSC,BS, MS, Phd, you have to fill all, for which i worte code , given below but how an insert statement would look like for it ,i have no idea anymore Using asp.net 3.5(c#),sql server 2008 .cs code: using System; using System.Data; using System.Configuration; 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; public …

Member Avatar
Member Avatar
+0 forum 1

is it true that no. of rows affected by select statement (ado.net) , is always -1. i.e. NO. OF ROWS AFFECTED BY SELECT STATEMENT = -1 ; if it is then why ?

Member Avatar
Member Avatar
+0 forum 1

i am sending emails to more than 1000 users at time , so i used a datatable to fetch email addresses from DB's table and then i loop over it voa foreach and then send it to each user via net.mail namespace's code that's ok, Done But problem is that it slows down the speed, it takes time to send a single line of data to such a heavy amount of users , So what is the appropriate way to improve performance , how to gain efficiency Help ! tools : asp.net 3.5 (c#) sql server 2008

Member Avatar
Member Avatar
+0 forum 2

i am getting error ERROR: The specified string is not in the form required for an e-mail address. but when i pass static email address , it works , why ? protected void Button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(connectionString); String command = "select visitorEmailID from tblvisitorSubscriptions"; SqlCommand sqlCom = new SqlCommand(command, con); SqlDataAdapter sqlDA = new SqlDataAdapter(command, con); DataTable DT = new DataTable(); try { con.Open(); sqlCom.ExecuteReader(); sqlDA.Fill(DT); foreach (DataRow dr in DT.Rows) { String Dr = Convert.ToString(dr["visitorEmailID"]); Response.Write("Email:" + "\"" + Dr + "\""); //Email sending part MailDefinition mailDefinition = new MailDefinition(); mailDefinition.From = "hunain.hafeez@gmail.com"; …

Member Avatar
Member Avatar
+0 forum 1

Hello I had a problem uploading or adding a file on the database and shows the error stated on the title. The column holding the binary data was set to varbinary(MAX). I couldn't find what was my error because I was able to upload a 900kb MS Word Document but it fails on a 51kb file. By the way, here is my table format. fileid int filetype varchar(50) filename varchar(50) filebytes varbinary(MAX) fileext varchar(10) posted datetime uploader varchar(50) I have a filter on each varchar fields so it won't produce an error. Please help. Thanks

Member Avatar
Member Avatar
+0 forum 3

Hi, I've been Searching the Net for hours now, and i can't really seem to find anything clear and straight to the point. I need to create a Server/Client application using VB.net 2008, it's actually my first time to have a database on another computer. So I first searched the internet for the things i need to make this software. -MSSQL Server 2008 (Not R2) -Management Studio -Vb.Net 2008 Express Edition -A Desktop (Client) -A Laptop (Server) - 1 Crossover Cable [U]What i have managed to do so far:[/U] 1. I have Connected and Established a connection between the two …

Member Avatar
Member Avatar
+0 forum 8

i am trying to pick a Varchar field (Question) from tblUser where email = session variable , it doesn't give error but picks -1 and shows it, why ? even that column isn't empt for the matching email code: String connectionString = "Data Source=COSANOSTRA; MultipleActiveResultSets=true; Initial Catalog=Waleed_orsfinal;Integrated Security=True"; protected void Page_Load(object sender, EventArgs e) { String user_Email = Session["Email_Forgot"].ToString(); SqlConnection con = new SqlConnection(connectionString); String query_qstn = "Select question from tblUser where email = '"+user_Email+"''; SqlCommand sqlCom = new SqlCommand(query_qstn,con); try { con.Open(); String qstn = Convert.ToString( sqlCom.ExecuteNonQuery()); Response.Write(qstn); } catch (Exception exc) { Response.Write("Error:"+ exc.Message); } finally { con.Close(); …

Member Avatar
Member Avatar
+0 forum 2

Error : SERVER TAG NOT WELL FORMED, why ? <%@ Page Language="C#" AutoEventWireup="true" CodeFile="employerView_ScrutinyMembers.aspx.cs" Inherits="employerView_ScrutinyMembers" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Scrutiny Members</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtboxMemberName" runat="server"></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="Search" onclick="btnSearch_Click" /> Or <asp:Button ID="btbViewall" runat="server" Text="View All" onclick="btbViewall_Click" /> <br /> <br /> <asp:GridView ID="GridViewAllScrutinyMembers" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="memberId" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:BoundField DataField="memberId" HeaderText="memberId" InsertVisible="False" ReadOnly="True" SortExpression="memberId" /> <asp:BoundField DataField="memberName" HeaderText="memberName" SortExpression="memberName" /> <asp:BoundField DataField="memberRole" HeaderText="memberRole" SortExpression="memberRole" /> <asp:BoundField DataField="memberSignature" HeaderText="memberSignature" SortExpression="memberSignature" /> <asp:BoundField DataField="memberDetails" …

Member Avatar
Member Avatar
+0 forum 3

i have an ajax Calender extender along with textbox in gridview, it works fine, when i select some date from calendar then it tranfers date to textbox and after clicking Update button in gridview , it sends date to database , Fine but when i don't select any thing from calender i.e. when textbox remains empty , and when i click update button , then it sends 1900-01-01, why ? please someone help ...... here is my code , even i treid if else conditions but else never gets executed , code: protected void GridView1_RowCommand(Object sender, GridViewCommandEventArgs e) { if …

Member Avatar
Member Avatar
+1 forum 2

i want to grab "DataValueField" of dropdownBox and want to use it in INSERT statement , so how ? i have already filled my Dropdownbox in grid view now want to get DataValueField and using it in insert statement , how ?

Member Avatar
Member Avatar
+0 forum 2

i am getting nothing , i am trying to retrieve checkbox value and email address from gridview via code, I am succeeded in getting Checkbox value successfully but cannt get email address, even grid view has it, but i cant get, just blank, here is the code: .cs : protected void GridViewAdminViewEmplys_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Update") { //Response.Write("Updated"); GridView gvr = GridViewAdminViewEmplys; int index = Convert.ToInt32(e.CommandArgument); int pk = Convert.ToInt32(GridViewAdminViewEmplys.DataKeys[index].Value); Response.Write(pk); bool isChecked = (gvr.Rows[index].Cells[8].Controls[0] as CheckBox).Checked; //CheckBox chk = (CheckBox)gvr.Rows[index].FindControl("chkBoxStatus"); // Response.Write(isChecked); if (isChecked == true) { String email = gvr.Rows[index].Cells[3].Text; Response.Write(email); Response.Write("TRUE CONDITION"); } …

Member Avatar
Member Avatar
+0 forum 3

i filled a gridview with tblUser, now gridview has a checkbox file (status), which is used to activate newly registered users, so i want to inform user via mail when admins activates him, mean when i (admin) checks checkbox field true, in edit mode of girdview then at that moment the user should get notification that u have been activated , mail code , + other neccessary code is prepared but i can't figure out that how to send mail at that time when i click check box, :( here is my code : <%@ Page Language="C#" MasterPageFile="~/MasterPageAdministration.master" AutoEventWireup="true" CodeFile="adminViewEmployers.aspx.cs" …

Member Avatar
Member Avatar
+0 forum 4

am near to cry bcz solving this problem took my whole day , simply, i am trying to get status of checkbox from grid view, so i converted it into tempaltefield and in .cs code i used findcontrol property but still getting 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: ***CheckBox …

Member Avatar
Member Avatar
+0 forum 3

i am trying to do something like this but it gives me error that **cannot convert int to string** , even the field which i am accessing from db is int and i parsed it into int but why ? here is my code: userId = (int)com.Parameters["@ReturnValueUserId"].Value; Response.Write(userId); SqlDataSource1.InsertParameters["@userId"] = userId; actually i am trying to insert userId into INSERTCOMMAND of sqldatasource control on .aspx page . InsertCommand="INSERT INTO [tblJobAdv] ([advtitle], [startingdate], [endingdate], [mediumofadv], [refid], [jbid], [advDetails], [userId]) VALUES (@advtitle, @startingdate, @endingdate, @mediumofadv, @refid, @jbid, @advDetails, @userId)" <InsertParameters> <asp:Parameter Name="advtitle" Type="String" /> <asp:Parameter DbType="Date" Name="startingdate" /> <asp:Parameter DbType="Date" Name="endingdate" /> …

Member Avatar
Member Avatar
+0 forum 2

my griedview is half shown on browser's screen and even it disabled horizontal scroller on screen (browser), why ? whenever i fill my gridview with many columns than it is half shown and disables scroller too, why ?

Member Avatar
Member Avatar
+0 forum 4

see i am using this mode of SQLDATASOURCE configuration ![154](/attachments/small/3/154.jpg "align-left") and now on the basis of this sql statement i want to generate UPDATE, INSERT, DELETE queries, especially UPDATE and i tried my best to do it but can't. this thing is quite possible in the mode given below in image ![154](/attachments/small/3/154.jpg "align-left") but the you can select firleds from one table only and i want to join two tables and generating UPDATE, insert queries on base of that help please , i wasted alot of time on it, here is my code : ASPX <%@ Page Language="C#" MasterPageFile="~/MasterPageAdministration.master" …

Member Avatar
Member Avatar
+0 forum 4

i am retrieving textual data from database on my page , asp.net(c#), now i want to save in pdf format and want to store that pdf file on my server(localhost) so how ?

Member Avatar
Member Avatar
+0 forum 2

during signup by applicant he/she must fill her educational details , total 5 educational levels, 1.ssc 2.hssc 3. BS 4. MS 5. Phd now lets say that an applicant has only BS passed then it mean that he/she would not have fill 4 and 5 option, now i want that there should be an option in signup page to add rows dynamically , say for 3 levels of education only to add and fill 3 rows of text boxes, so how ? or if u ppl have any other alternative then share please Here is my Database table structure to …

Member Avatar
Member Avatar
+0 forum 1

*.cs page code* using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class advertisementSubmission : System.Web.UI.Page { protected String EmplyrSession; protected int userId; protected void Page_Load(object sender, EventArgs e) { EmplyrSession = (String)Session["UserEmail"]; Response.Write(EmplyrSession); String conString = "Data Source=COSANOSTRA;Initial Catalog=Waleed_orsfinal;Integrated Security=True"; //Sql Connection SqlConnection con = new SqlConnection(conString); //Sql Command SqlCommand com = new SqlCommand("advSubmissionUserid", con); com.CommandType = CommandType.StoredProcedure; com.Parameters.Add("@sessionVar", SqlDbType.VarChar).Value = EmplyrSession; com.Parameters.Add("@ReturnValueUserId", SqlDbType.Int).Direction = ParameterDirection.ReturnValue; try { con.Open(); com.ExecuteNonQuery(); userId = (int)com.Parameters["@ReturnValueUserId"].Value; Response.Write(userId); SqlDataSource1.InsertParameters["@userId"].DefaultValue = userId.ToString(); } catch (Exception …

Member Avatar
Member Avatar
+0 forum 1

***using select query result in insert query*** ***i have this code in .cs Page .cs page*** String query = "select userid from tblUser where email='" + EmplyrSession + "'"; SqlCommand com = new SqlCommand(query, con); try { con.Open(); int noRows= com.ExecuteNonQuery(); Response.Write(noRows); } catch (Exception ex) { Response.Write("Sql Error:" + ex.Message); } finally { con.Close(); } ***Now i want to use the result returned by this query i.e. userid, in .aspx page, *** String query = "select userid from tblUser where email='" + EmplyrSession + "'"; ***i want to use the result returned by this query i.e. userid, in .aspx …

Member Avatar
Member Avatar
+0 forum 7

in databse tabel i have fieild with type varbinary(max) for storing image, so i achieved it and stored my image but the problem is that when i use this line SqlParameter p8 = new SqlParameter("logo", SqlDbType.VarBinary).Value= productImage; then it gives me an error but when i use this line : com.Parameters.Add("@logo", SqlDbType.VarBinary).Value = productImage; then it works , WHY ?????? NoteL i am using asp.net 3.5 + sql server 2008 , and using SP to execute it which i achieved but confused about the problem above. HELP !

Member Avatar
Member Avatar
+0 forum 2

i stored session variable in string variable in .cs page , but now i want to retrieve that string variable on .aspx page and want to put into selectcommand of sqldatasource how ?

Member Avatar
Member Avatar
+0 forum 1

am using asp.net 3.5(c#) + sql server 200 DB, doing this GIVES me an error , *Error:The multi-part identifier "email@yahoo.com" could not be bound* why ??? using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class advertisementSubmission : System.Web.UI.Page { protected String EmplyrSession; protected void Page_Load(object sender, EventArgs e) { EmplyrSession = (String) Session["UserEmail"]; Response.Write(EmplyrSession); String conString = "Data Source=COSANOSTRA;Initial Catalog=Waleed_orsfinal;Integrated Security=True"; //Sql Connection SqlConnection con = new SqlConnection(conString); //Sql Command String query = "select userid from tblUser where email=" + …

Member Avatar
Member Avatar
+0 forum 6

The End.