|
Any more information should help...
How do you create this database... Did you use a the scripting wizard of Microsoft SQL, or did you use the tool ?
Ensure that you're scripting the correct version (i.e., if the remote PC has 2005 , ensure to script 2005... etc...)
Hope this help...
|
|
|
|
|
Every1 help is highly appreciated.
But the solution i discovered after many attempts is that I generate 5 different script files 1>database_roles , 2>schema, 3>stored procedures, 4>tables, 5>views through sql server 2005.
Then in asp.net i write a function that accept file name to execute script , reading the file with streamreader then executing through executenonquery, i stored all 5 names in array and through for loop i executed the scripts 1 by 1 and it worked fi9.
Thanks Every1.
|
|
|
|
|
can any body please tell me that i m using asp.net 3.5 and i have two pages 1) C# and 2nd vb.net which is master page
i am assigning value to arraylist from C# page and then adding its object to session and then retrieving in master page
while adding those values in vb.net master page dropdownlist it gives me error "object reference not set to an instance of the object" or null referece exception.
Dim bname As New ArrayList()
bname = Session("BranchSName")
Me.DropDownList1.Items.Clear()
Dim i As Integer
For i = 0 To bname.Count
Me.DropDownList1.Items.Add(bname.Item(i)) -> error here
Next
please help where is the problem while same code is working fine in normal pages.
umerumerumer
|
|
|
|
|
I really want to help you. But I'am very sorry, beacase I do don't know the problem!
come on
|
|
|
|
|
Using a database such as sql how can we display its data in asp.net page as bar graph???
|
|
|
|
|
you can use 3rd party controls like infragistic controls,component 1....
you just need to get data in data set and then asssign two properties
1)datasource
2)databind you bar graph will be ready ...
umerumerumer
|
|
|
|
|
Use css and that sort of thing and you can create a very basic one, or use GDI and make an image and use the img html tag to refer to it.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
Hi,
I've been assigned a new project - online shopping website for a shop that sells TVs, music systems etc..
I've to start from scratch and I've no prior experience working with such an application. What I've to use is MIGS (Mastercard Internet Gateway Service) coz thats what the bank here support.
Where do I start from? I was hoping to use Dotnetnuke but it does not have any built-in or custom modules that supports MIGS. Nobody in my team has any experience in such a project, still we have to do this website coz this is for our group company!
Could anyone guide me how to go about laying a foundation for this, like where to refer for starting designing the database and application?
Regards,
Manu
“The thing for you is a burial permit. You have only to speak and I will see that you get it.”
|
|
|
|
|
Hi all,
I have to use MYSQL Database server as beckend for asp.net 2.0 web application. i have downlaoded and installed the MYSQL on my development machine(windows XP) and also downlaoded MYSQL Administrator for ease.
what are the remaining things which are essentail for connection asp.net 2.0 with MYSQL Database .
Best Regards
Rameez
|
|
|
|
|
You need to install ODBC connection drivers 3.1 ( i guess) for connecting. And you will be ready to go.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
MySql connector .NET[^]. It contains ADO.NET classes which can be used to connect with MySql. Using ODBC is not a good idea. ODBC adds and extra layer to the communication and will be slow.
|
|
|
|
|
Hey Guys,
I'me having a difficult time with a Menu control which is bound to a site map. We have a website where we allow the user to go along several paths via different instances of the browser, while logged in with a single session. To get around this we pass a single querystring value around to identify where each window is, a transaction id for instance. I'm having a difficult time figuring out how to append that dynamic querystring value value to the end of the navigation url attached to each menu item of a sitemap bound menu control.
We tried just some basic tests of hooking up the onprerender event and using something like this:
menuItem.NavigateUrl += "?Test =" + Request.QueryString["Test"];
But the query string object doesn't seem to survive multiple post backs.
Any ideas would be greatly appreciated,
Thanks,
Ryan
|
|
|
|
|
I have a Table.It is containing 4 column RegionID, MapFillColor, MapLineColor, MapCoordinates.
I want to run insert statement if the record is new when button press. But if the record already exist it should update the record REGIONID is primary Key in my Table. I donot know where i should put my function which check first the record exist if so then run update else insert statement.
Here is my Code
using System;
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 _Default : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=ZAFAR-PC\\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("Insert into Region(RegionID,MapFillColor, MapLineColor, MapCoordinates) values( '" + RegionID_txt + "','" + MapFillColor_txt + "','" + MapLineColor_txt + "','" + MapCoordinates_txt + "')", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
|
|
|
|
|
Check it just above your insert statement.
|
|
|
|
|
Check for RegionId.
if (RegionId == "")
// then Insert
else
// Update.
Or if you can't get region Id, check the entry exists in database first. Like
if (RecordExists) // RecordExist is a boolean function which return true or false.
// then Update
else
// Insert
protected bool RecordExists()
{
bool retvalue = false;
// Write the queries which returns the result set
// If ResultantDataSet contains rows
retvalue = true;
else
retvalue = false;
return retvalue;
}
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
This should really be done in the SQL server using SP's..else you leave your server open to all manner of attacks..
Then you can also do the check in the sp and if exists update rather then insert
|
|
|
|
|
Thank you for reading this post. I am new to Javascript and ASP.NET development so please bear with me. I have a page that renders fine in IE but the same functionality gives me error in Firefox. I have a form which has a bunch of check boxes and there is a a particular checkbox lets call it ABC, and clicking on it, it needs to uncheck the other boxes, and if other check box is clicked, it shud uncheck the the ABC checkbox. The checkbox are created dynamically through code in a table cell. My app works fine in IE but not in Firefox. I know there are a few keywords that is Microsoft proprietary, and is not all browser friendly, but i cannot figure out how to change it. Here is my code below. All help is appreciated. the error I get in Firefox and Safari when I click on any checkbox is ctrl.ParentElement has no properties. All help and code sample/corrections are appreciated. Please note: I am a systems support guy who has to maintain pages.
function ValidateCheckedValues( ctrl , isChecked )
{
// Purpose : This function is called when the user clicks on any checkbox in the equipment requirements table on the page
// If the user clicks on the "ABC" checkbox it clears all the check boxes for that meeting,
// but if the user checked any other checkbox, it removes the check from the "ABC" checkbox
try
{
if( ctrl.parentElement.attributes("SubCode").value == "NONE" )
{
if( isChecked )
{
for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ )
{
ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false;
}
ctrl.checked = true;
}
}
else
{
if( isChecked )
{
for( counter = 3 ; counter < ctrl.parentElement.parentElement.parentElement.children.length ; counter++ )
{
if( ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).attributes("SubCode").value == "NONE" )
{
ctrl.parentElement.parentElement.parentElement.children( counter ).children( 0 ).children( 0 ).checked = false;
}
}
}
}
}
catch( ex )
{
alert( ex.message );
}
}
|
|
|
|
|
Let me guess... You are calling the function with the name of the element as first parameter instead of an actual reference to the element?
Internet Explorer adds references to the elements in the page as members of the document object. This makes it easy to access the elements, but it's non-standard so it won't work in any other browser.
Use the document.getElementById method to get a reference to the element.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi
I have written the following asp.net page and creating the xml file through a method everything is fine it is creating the file but i have a problem. May be you can help for that. it is about the xml file output when it created it showing TABLE and TABLE1 as node in xml how i can change it to meaningful name. My Code is as follows. XML file is at the bottom of the code
using System;
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.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.IO;
public partial class _Default : System.Web.UI.Page
{protected void Page_Load(object sender, EventArgs e){
GetEmployees("London");
}
public static void GetEmployees(string City){
//String sConnection = "server=HTCWEBDEMO;database=hometrust;user id=ht_admin;password=htc_tr!st";
String sConnection = "server=ZAFAR-PC\\SQLEXPRESS;Integrated Security=SSPI;database=northwind";
SqlConnection mySqlConnection = new SqlConnection(sConnection);
mySqlConnection.Open();
// Get the same data through the provider.
//string mySQLStatement = "SELECT Title,FirstName,LastName,PhoneNumber,Faxnumber, email from contactlist where TeamName='" + TeamName +"'; select FirstName, LastName from contactlist where TeamMorty ='True' and teamname='" + TeamName + "';";
string mySQLStatement = "SELECT FirstName,LastName,Title,City from employees where city= '" + City + "';select FirstName, LastName from employees where city='" + City + "';";
//SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);
DataSet myDataSet2 = new DataSet();
myDataSet2.DataSetName = "Contacts";
mySqlDataAdapter.Fill(myDataSet2);
// Write data to files: data1.xml and data2.xml for comparison.
myDataSet2.WriteXml("c:/temp/ContactList.xml");
mySqlConnection.Close();
}
}
XML FILE OUTPUT
<?xml version="1.0" standalone="yes" ?>
- <Contacts>
- <Table>
<FirstName>Steven</FirstName>
<LastName>Buchanan</LastName>
<Title>Sales Manager</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Michael</FirstName>
<LastName>Suyama</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Robert</FirstName>
<LastName>King</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Anne</FirstName>
<LastName>Dodsworth</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table1>
<FirstName>Steven</FirstName>
<LastName>Buchanan</LastName>
</Table1>
- <Table1>
<FirstName>Michael</FirstName>
<LastName>Suyama</LastName>
</Table1>
- <Table1>
<FirstName>Robert</FirstName>
<LastName>King</LastName>
</Table1>
- <Table1>
<FirstName>Anne</FirstName>
<LastName>Dodsworth</LastName>
</Table1>
</Contacts>
|
|
|
|
|
Stop posting and reposting your problem and do the work yourself, or get a different job because you are not qualified for the one you have. Either way, I don't care, but stop littering the CP forums with your garbage.
original[^]
led mike
|
|
|
|
|
Hi,
I have a GridView that fits my page perfectly. It's set to 800px and I have each column's width set to 10% - there are ten columns. Unfortunately, when I click on the Edit button (a command field), the width of the GridView is screwed up - it extends beyond the width of the browser window. I've tried setting the ItemStyle-Width and ControlStyle-Width on each column with no effect and I've also tried setting the EditRowStyle Width to 800px again with no effect.
Can someone tell me what I'm doing wrong and how to control what width the edit row should be?
Thanks
|
|
|
|
|
Provide the width measurement only in percent like 50% or 100%. Pixel measurements will always have display issues.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi
I've got this message and I don't know how to solve the problem.
Error message first, Source code and then the example of SQL connection.
Error message:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
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:
[InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +1184409
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +196
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, String spName, Object[] parameterValues) +222
FG2007.objUser.LoginUser(String UserName, String Password) +108
FG2007.Login.Btn_Login_Click(Object sender, ImageClickEventArgs e) +510
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.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
Source code:
public partial class Login : System.Web.UI.Page
{
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.btn_Login.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_Login_Click);
this.btn_PukReg.Click += new System.Web.UI.ImageClickEventHandler(this.Btn_PukReg_Click);
}
#endregion
protected void Page_Load(object sender, System.EventArgs e)
{
UserName.Attributes.Add("onkeypress", "return handleEnter('" + btn_Login.ClientID + "', event)");
txtPuk.Attributes.Add("onkeypress", "return handleEnter('" + btn_PukReg.ClientID + "', event)");
if (!IsPostBack)
{
if (Request.Cookies["USERNAME"] != null)
UserName.Text = Request.Cookies["USERNAME"].Value;
if (Request.Cookies["PASSWORD"] != null)
Password.Attributes.Add("value", Request.Cookies["PASSWORD"].Value);
if (Request.Cookies["USERNAME"] != null && Request.Cookies["PASSWORD"] != null)
RememberMe.Checked = true;
}
emailp = Request.QueryString["emailp"];
if (emailp != null)
{
txtPuk.Text = emailp;
}
if (!IsPostBack)
{
string mode = Request.QueryString["mode"];
switch (mode)
{
case "pukbad":
lblPukMsg.Text = BADPUK;
lblPukMsg.ForeColor = Color.Red;
Helpers.SetFocus(this, txtPuk);
break;
case "pukformsaved":
lblPukMsg.Text = PUKFORMSAVED;
lblPukMsg.ForeColor = Color.Green;
Helpers.SetFocus(this, txtPuk);
break;
default:
lblPukMsg.Text = string.Empty;
Helpers.SetFocus(this, txtPuk);
break;
}
}
else
if (UserName.Text.Length > 0)
{
Helpers.SetFocus(this, UserName);
}
else
Helpers.SetFocus(this, txtPuk);
if (emailp != null)
{
lblPukMsg.Text = string.Empty;
lblPukMsg.ForeColor = Color.Red;
txtPuk.Text = txtPuk.Text.Trim().ToUpper();
switch (txtPuk.Text.Length)
{
case 10:
switch (objContract.CheckPuk(txtPuk.Text))
{
case 0:
case 1:
break;
case -1:
lblPukMsg.Text = BADPUK;
break;
case 2:
lblPukMsg.Text = PUKUSED;
break;
}
break;
case 12:
Guid ContractID = Guid.Empty;
Guid GroupID = Guid.Empty;
Guid FormID = Guid.Empty;
if (objGroup.CheckPuk(txtPuk.Text, out ContractID, out GroupID, out FormID) >= 0)
{
Helpers.SetCurrentContract(ContractID);
Helpers.SetCurrentGroup(GroupID);
Helpers.CheckCurrentGroup();
if (FormID != Guid.Empty)
{
lblPukMsg.Text = PUKUSED;
}
else
{
if (objContract.Current.AspektMode <= 0 && objContract.Current.ShowReports)
{
lblPukMsg.Text = CONTRACT_FINALIZED;
}
else
{
}
}
}
else
lblPukMsg.Text = BADPUK;
break;
default:
lblPukMsg.Text = BADPUK;
break;
}
}
}
private void Btn_Login_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
if (RememberMe.Checked == true)
{
Response.Cookies["USERNAME"].Value = UserName.Text;
Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(30);
Response.Cookies["PASSWORD"].Value = Password.Text;
Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(30);
}
else
{
Response.Cookies["USERNAME"].Expires = DateTime.Now.AddYears(-30);
Response.Cookies["PASSWORD"].Expires = DateTime.Now.AddYears(-30);
}
objUser user = objUser.LoginUser(this.UserName.Text, this.Password.Text);
if (user != null)
{
Session["CurrentUser"] = user;
if (user.uType != objUser.UserType.Free)
{
Helpers.CheckCurrentContract();
Helpers.CheckCurrentGroup();
}
switch (user.uType)
{
case objUser.UserType.Super:
case objUser.UserType.Admin:
case objUser.UserType.Ledare:
Response.Redirect("Contracts.aspx", true);
break;
case objUser.UserType.Medlem:
Response.Redirect("Puks.aspx", true);
break;
case objUser.UserType.Free:
Response.Redirect("Support.aspx", true);
break;
case objUser.UserType.Viewer:
Response.Redirect("Reports.aspx", true);
break;
}
}
else
{
this.Lbl_Msg.ForeColor = Color.Red;
this.Lbl_Msg.Text = "<br>Fel användarnamn <br>eller lösenord.<br><br>";
}
}
Using these kind of SQL-connections:
public static DataSet ListUsers()
{
return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
}
|
|
|
|
|
First of all use the CODE tag whenever you are posting code. your current code is unreadable.
ok so You are not closing the existing connection. close the connection as soon as you finished communicating.
i.e. after using the reader/datatable/dataset, insert/delete/update query.
if you are closing the connection and then also you are getting the error, due to very busy website. change the MAX POOL SIZE in the connection string.
connectionString="Server=XXX;Database=XXX;User Id=XXX;password=XXX;connection timeout=0;Max Pool Size = 100;Pooling = True"
|
|
|
|
|
Thanks for your reply
I have corrected CODE tag
I know that I am not closing the existing connection, but I do not know which, that's the problem
Thanks Anders
|
|
|
|
|