|
Hi I am new to programming with ASP.Net and I am looking for some information.
I currently have a database locally on my machine, and I am trying to connect and read one of the tables through the VB. I have gone to many website, and tried a couple of things but I get up to a point and its still crashing when I go to open it. One thing you will notice is that I do not have a password on my database because there is not one on my machine.
This is the code I have in my page load
Dim oConn As New System.Data.SqlClient.SqlConnection
Dim oCom As System.Data.SqlClient.SqlCommand
Dim oDr As System.Data.SqlClient.SqlDataReader
Dim sSQL As String
sSQL = "SELECT * FROM AdminTypes"
oConn = New System.Data.SqlClient.SqlConnection("server=MCF1500\SQLEXPRESS;uid=JWilson;pwd=;database=MCF_Staff;Trusted_Connection=yes")
oConn.Open() 'Crashes HERE
oCom = New System.Data.SqlClient.SqlCommand(sSQL, oConn)
oDr = oCom.ExecuteReader()
Do While oDr.Read()
' Show database data
Loop
oConn.Close()
And I have this code in my WEB.config File
<configuration>
<appsettings>
<add key="DBConString" value="Uid=JWilson;pwd=;server=MCF1500\SQLEXPRESS;database=MCF_Staff" />
</appsettings>
<system.web></system.web></configuration>
I was wondering if anyone could help me out with his. If so it would be much appreciated. If not then I am switching over to PHP for this project because I understand it better.
|
|
|
|
|
Odd the webconfig code did not show lets post that again
<configuration>
<appSettings>
<add key ="DBConString" value="Uid=JWilson;pwd=;server=MCF1500\SQLEXPRESS;database=MCF_Staff" />
</appSettings>
<system.web>
|
|
|
|
|
Ragonastick wrote: One thing you will notice is that I do not have a password on my database because there is not one on my machine.
If you are talking about SQL Server Management Studio is not asking you a password, then you are login using windows authentication. and you are using sql authentication in your application, so you cannot login.
if this is the case then,
open sql server management studio using your windows authentication, now go to security -> Login abd create one login with username & password, and then use that username & password in your application to login.
you cannot login to sql server without specifying a password in your connection string.
|
|
|
|
|
Thanks man I think you are correct. I am looking around but I think the guy that was working on this project before I started working on it did not write it down or leave any information on the password he left. Looks like I may have to reinstall, and back up the files.
|
|
|
|
|
Can anybody tell me the reason behind this type of error...Is my framework corrupted??
Could not write to output file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website\6689c1b9\c4abb612\App_Web_evww1nqy.dll' -- 'Access is denied. '
|
|
|
|
|
Have a look here[^].
Calin
|
|
|
|
|
I'am creating a website where the front-end is bein developed using ASP .NET,the code so far has been written using VB .NET and all data is stored using MS SQL Server 2000.Everytime the user logs in and performs some activity the database contents are changed correspondingly.
Now i need a process that runs in the background on the server side such that everytime a user fills in a particular form, the process initiates a timer for say,15 mins and wen the timer expires some database modifications are made.This has to be true for every incoming request from the user.So if Im not wrong i need a daemon process that awaits an incoming request and then performs the above-said activity. I have no idea what i need to use in order to achieve this.Please help.
modified on Tuesday, March 10, 2009 11:33 PM
|
|
|
|
|
|
Trying to get something written that will trap all FTP traffic and add IP address to blocked list after X number of failed login attempts.
Not sure where to even start looking for a way to write this.
Any pointers would be greatly appreciated
other than that loving IIS7
OR if you know of something that already does it.... please save me the pain and point me that way as well.
|
|
|
|
|
visible='<%Convert.ToBoolean((RecordingConfigurationManager.sysConfig.GetLicensedChannels(RecordingConfigurationManager.current.CaptureModule.CaptureTypeId) - (Int64)RecordingConfigurationManager.current.CaptureModule.cacheCaptureDS.tblLoggerCapture.Compute("SUM(iUsedChannels)", "")) > 0))?True:False %>'
I have a webpage with a hidden textbox and a combo. The textbox should becaome visible and validated when a specific value ("other") in the combo is selected. To validate it, I use a requiredFieldValidator.
To toggle the validation of the validator, I should enable / disable it both in the client side and in the server side.
To toggle the validation in the client side, I used javascript "ValidatorEnable" function and also switched the validation group from "tuti" (the validated group) to "nonValidated" (the non-validated group).
On the server side, I also made the same validation group toggling acording to the combo selected value.
after that I used Page.Validate("tuti"). but when I checked Page.isValid, I got false even when the validation group was changed (in JS and in sever side!).
Here is the ASPX file:
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AJAXEnabledWebApplication2._Default" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <script type="text/javascript" src="jquery.js"></script>
8 <title>Untitled Page</title>
9 </head>
10 <body>
11 <form id="form1" runat="server">
12 <asp:ScriptManager ID="ScriptManager1" runat="server" />
13 <div>
14 <asp:DropDownList ID="ddlMimeType" runat="server">
15 <asp:ListItem Value="mp3">audio/mpeg</asp:ListItem>
16 <asp:ListItem Value="wma">audio/wma</asp:ListItem>
17 <asp:ListItem Value="other">Other</asp:ListItem>
18 </asp:DropDownList>
19 <asp:TextBox ID="txbOtherMimetype" runat="server" />
20 <asp:RequiredFieldValidator ID="valEncOtherMimetypeRequired" runat="server" ControlToValidate="txbOtherMimetype"
21 ForeColor="#990066" ErrorMessage="You have to specify a custom mimetype." ValidationGroup="tuti" />
22
23 <%-- runat="server" ID="sampling"></asp:TextBox>
24 <asp:RequiredFieldValidator runat="server" ID="testi" ControlToValidate="sampling"></asp:RequiredFieldValidator>--%>
25 <asp:LinkButton runat="server" Text="buttonit" CausesValidation="true" ID="buttonit" ValidationGroup="tuti" OnClick="SaveValues"></asp:LinkButton>
26 <asp:LinkButton runat="server" Text="NoTuti" CausesValidation="true" ID="LinkButton1" OnClick="SaveValues"></asp:LinkButton>
27 </div>
28 </form>
29
30 <script type="text/javascript">
31 $(document).ready(function() {
32 toggleOtherMimeType(("#<%= ddlMimeType.ClientID %>"))
33 });
34
35
36 $(document).ready(
37 function() {
38 $("#<%= ddlMimeType.ClientID %>").change(
39 function() {
40 toggleOtherMimeType(this);
41 });
42 }
43 )
44
45 function toggleOtherMimeType(elem) {
46 var valEncOtherMimetypeRequired = document.all ? document.all["valEncOtherMimetypeRequired"] : document.getElementById("valEncOtherMimetypeRequired");
47 var buttonit = document.all ? document.all["buttonit"] : document.getElementById("buttonit");
48 if (elem != undefined) {
49 if (elem.value == "other") {
50 $("#<%= txbOtherMimetype.ClientID %>").show();
51 ValidatorEnable($("#<%= valEncOtherMimetypeRequired.ClientID %>")[0], true);
52 valEncOtherMimetypeRequired.validationGroup = "tuti";
53 buttonit.validationGroup = "tuti";
54 }
55 else {
56 $("#<%= txbOtherMimetype.ClientID %>").hide();
57 ValidatorEnable($("#<%= valEncOtherMimetypeRequired.ClientID %>")[0], false);
58 valEncOtherMimetypeRequired.validationGroup = "NoValidate";
59 buttonit.validationGroup = "NoValidate";
60 }
61 }
62 alert(valEncOtherMimetypeRequired.validationGroup);
63
64
65 }
66
67
68
69 </script>
70
71 </body>
72 </html>
73
and the CodeBehind:
1 using System;
2 using System.Data;
3 using System.Configuration;
4 using System.Collections;
5 using System.Web;
6 using System.Web.Security;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9 using System.Web.UI.WebControls.WebParts;
10 using System.Web.UI.HtmlControls;
11
12 namespace AJAXEnabledWebApplication2
13 {
14 public partial class _Default : System.Web.UI.Page
15 {
16 protected void Page_Load(object sender, EventArgs e)
17 {
18
19 }
20
21 protected void SaveValues(object sender, EventArgs e)
22 {
23 if (ddlMimeType.SelectedValue != "other")
24 {
25 valEncOtherMimetypeRequired.ValidationGroup = "NoValidate";
26 buttonit.ValidationGroup = "NoValidate";
27 }
28 else
29 {
30 valEncOtherMimetypeRequired.ValidationGroup = "tuti";
31 buttonit.ValidationGroup = "tuti";
32 }
33 Page.Validate("tuti");
34 System.Diagnostics.Debug.WriteLine("ddl validation group is: " + valEncOtherMimetypeRequired.ValidationGroup);
35 System.Diagnostics.Debug.WriteLine("is page valid? " + Page.IsValid);
36
37 }
38 }
39 }
40
Any ideas how to disable fully the validation?
thanks,
Hadar
|
|
|
|
|
What is meant by Deferred Evaluation??
Wtat is the use of that one in LINQ??
Thanks,
NKMKrishna
|
|
|
|
|
|
What is the use of the GridView .Where i should be use.Give me an
example for that.
by
che
|
|
|
|
|
Refer some books,google and get some basics,dont try jump in the middle and deepest part first.
modified on Tuesday, March 10, 2009 8:45 AM
|
|
|
|
|
It is used to display data stored in some database table.
You can goggle about it too.
|
|
|
|
|
GridView is used to show the data from database.
It will help you and if you google, you can get more samples like this.
<a href="http://www.codeproject.com/KB/aspnet/ScrollingGridView.aspx">http://www.codeproject.com/KB/aspnet/ScrollingGridView.aspx</a>[<a href="http://www.codeproject.com/KB/aspnet/ScrollingGridView.aspx" target="_blank" title="New Window">^</a>]
Balasubramanian K.
|
|
|
|
|
i used to use gridview to show detail record from certain header. for example, i record data from Purchase order which contains POHeader saved in table named T_Header that consist of Pono, podate,requester,supplier, and orderdetail saved in table named T_Detail consist of orderlineno, partcode, and priceunit which is recorded line by line. all orderdetail i have recorded shown in gridview.
regards,
edi
gain new knowledge through knowledge-sharing
|
|
|
|
|
Hi all
I am facing problem while updating date in the gridview.
My database is sqlclient.
The field is in DateTime Format.I am using the updatecommand of gridview to update the date but the change is not reflecting.The date is getting captured as mm/dd/yyyy 12:00:00 AM.
Please tell me how to update this field.
|
|
|
|
|
are you using AJAX ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Check you control panel settings.
But in your programe itself you can change the format....
Balasubramanian K.
|
|
|
|
|
Hi again
Thanks for the reply.But I am not using AJAX and I dont know how to format the date so that it gets updated via gridview.Kindly help me in this regard!!
|
|
|
|
|
how to add confirmation check on add button click and if user say ok then insert data in database ? in cofirmation i have to show data in my file upload control and drop down list for simple cofirmation i use but how to add these enteries in confirmation.
btn_add.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to save the file')");
modified on Tuesday, March 10, 2009 7:41 AM
|
|
|
|
|
http://www.codeproject.com/KB/webforms/NingLiangSimpleControl.aspx[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
As an alternative you can use subModal scripts, which provides cusomizable Modal Dialogs.
Regards,
Cybernate
|
|
|
|
|
Dear Experts,
I want send the mail via asp.net 1.1. I used some codes.Problem is there is no exception,but mail is not receiving.
I give the some codes as follows as
Public Function MailSend() As Boolean
Dim boolReturn As Boolean = True
Try
Dim MailMsg As New MailMessage
Dim strFromMailId, strToMailId, strSMTPNo As String
If Not System.Configuration.ConfigurationSettings.AppSettings.Get("FromMailId") Is Nothing Then
strFromMailId = System.Configuration.ConfigurationSettings.AppSettings.Get("FromMailId")
End If
If Not System.Configuration.ConfigurationSettings.AppSettings.Get("ToMailId") Is Nothing Then
strToMailId = System.Configuration.ConfigurationSettings.AppSettings.Get("ToMailId")
End If
If Not System.Configuration.ConfigurationSettings.AppSettings.Get("SMTPNO") Is Nothing Then
strSMTPNo = System.Configuration.ConfigurationSettings.AppSettings.Get("SMTPNO")
End If
Dim strUserName, strPwd, strAccName As String
If Not System.Configuration.ConfigurationSettings.AppSettings.Get("MailUserName") Is Nothing Then
strUserName = System.Configuration.ConfigurationSettings.AppSettings.Get("MailUserName")
End If
If Not System.Configuration.ConfigurationSettings.AppSettings.Get("MailPWD") Is Nothing Then
strPwd = System.Configuration.ConfigurationSettings.AppSettings.Get("MailPWD")
End If
If Not System.Configuration.ConfigurationSettings.AppSettings.Get("MailAccName") Is Nothing Then
strAccName = System.Configuration.ConfigurationSettings.AppSettings.Get("MailAccName")
End If
MailMsg.From = strFromMailId
MailMsg.To = strToMailId
MailMsg.Subject = "test Mail"
MailMsg.Body = "This is content"
MailMsg.Priority = MailPriority.High
'Dim sm As SmtpMail
'SmtpMail.SmtpServer = "127.0.0.1"
MailMsg.Fields.Clear()
MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", strSMTPNo)
MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", strUserName)
MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", strPwd)
MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpaccountname", strAccName)
MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
SmtpMail.Send(MailMsg)
boolReturn = True
Catch ex As Exception
Response.Write(ex.Message)
boolReturn = False
End Try
Return boolReturn
End Function
Note : In our smtp server have username and password which are defined in wen.config.
If any body known reply me
Regards
Mani
|
|
|
|