Quantcast
Channel: DataSource Controls - SqlDataSource, ObjectDataSource, etc.
Viewing all 956 articles
Browse latest View live

Can I get data from sqldatasource with codebehind?

$
0
0

Hi, I don't know if i's a silly question.

Now I want to get data from sqldatasource by only write some code,I don't know without creat some data control components if it can be true?

If it can do,how can I write the codes?

Especially I don't know how to write the code witch can "read" data.


Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.

$
0
0

Hi,

I have developed a custom server control for .NET Framework 2.0. The server control has a property named BinaryData of type byte[]. I marked this property to be data bindable. Now, I have varbinary(Max) type of field in my SQL Database and I have used SQLDataSource and bound this varbinary(Max) field with the property BinaryData (byte[]) of my control. It is working fine as long as the data value is not NULL. Now, In my control, I have handled the NULL value so that no Exception is thrown. Still, when I bind this property using the SQLDataSource, I get Error "Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'." I am not sure if I can do anything to stop this erro within my control. If it is not possible from the control, then what is the workaround that I can do in my ASPX page in order to stop this error ?

Thanks a lot in advance.

Filter the DataGrid using the value from textbox

$
0
0

Hi everyone, so here I'm trying to filter the DataGrid using the value typed in the textbox (linked with a stored procedure 'msProject_Select' and using a table adapter 'DsPlaygroundProject'), which is fine before I decide to put parameter @ProjectCode in the stored procedure, now it's not working, please help

here's the .vb code:

Imports System.Data.SqlClient

Public Class P00_LookupProjectCode

    Public ExMessage As String

    Public F01_Res_Table As New DsPlaygroundProject.msProject_SelectDataTable
    Public Function F01_sysError_Select() As ProcessResult
        Try
            Dim Ta As New DsPlaygroundProjectTableAdapters.msProject_SelectTableAdapter
            Ta.Connection = New SqlClient.SqlConnection(CF.CfgConnectionString)
            F01_Res_Table = Ta.msProject_Select()

            If F01_Res_Table.Rows.Count > 0 Then
                Return ProcessResult.SuccessWithResult
            Else
                Return ProcessResult.SuccessWithNoResult
            End If
        Catch ex As Exception
            ExMessage = ex.Message
            Return ProcessResult.Failed
        End Try
    End Function

    Public F02_Dt_msProject As New DsPlaygroundProject.msProject_SelectDataTable
    Public Function F02_msProject_Select(ByVal ProjectCode As String) As ProcessResult
        Try
            Dim SqlCmd As New SqlCommand()
            SqlCmd.Connection = New SqlConnection(CF.CfgConnectionString)
            SqlCmd.CommandType = CommandType.StoredProcedure
            SqlCmd.CommandTimeout = CF.CfgCommandTimeout
            SqlCmd.CommandText = "msProject_Select"
            SqlCmd.Parameters.Add("@ProjectCode", SqlDbType.VarChar)

            SqlCmd.Connection.Open()

            Dim Dr As SqlDataReader = SqlCmd.ExecuteReader(CommandBehavior.CloseConnection)
            F02_Dt_msProject.Clear()
            F02_Dt_msProject.Load(Dr)

            If F02_Dt_msProject.Rows.Count > 0 Then
                Dr.Close()
                Dr = Nothing
                SqlCmd.Dispose()
                Return ProcessResult.SuccessWithResult
            Else
                Dr.Close()
                Dr = Nothing
                SqlCmd.Dispose()
                Return ProcessResult.SuccessWithNoResult
            End If

        Catch ex As Exception
            InsertErrorLog("P00_LookupProjectCode.F02_msProject_Select", ex.Message)
            ExMessage = ex.Message
            Return ProcessResult.Failed
        End Try

    End Function

and the code behind:

Partial Public Class P00_LookupProjectCode
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = True Then
            Exit Sub
        End If

        Dim Bl As New P00_LookupProjectCode
        If Bl.F02_msProject_Select() Then
            DGV.DataSource = Bl.F02_Dt_msProject
            DGV.DataBind()
        Else
            LblMessage.Text = Bl.ExMessage
        End If
    End Sub

    Private Sub DGV_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles DGV.PageIndexChanging
        DGV.PageIndex = e.NewPageIndex
        Dim Bl As New P00_LookupProjectCode
        If Bl.F01_sysError_Select = CF.ProcessResult.SuccessWithResult Then
            DGV.DataSource = Bl.F01_Res_Table
            DGV.DataBind()
        Else
            LblMessage.Text = Bl.ExMessage
        End If
    End Sub

    Protected Sub BtnSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles BtnSearch.Click

    End Sub

and the stored procedure:

ALTER PROCEDURE [dbo].[msProject_Select]
@ProjectCode varchar(50)
AS
BEGIN
	  SET NOCOUNT ON;

	  SELECT [projectCode]
	  		,[projectName]
	  FROM master..[MS_Project]
	  WHERE [projectCode] like '%' + @ProjectCode + '%'
	  ORDER BY [projectCode] ASC
END

the idea is, I want to click the button after type in the keyword in the TbProjectCode textbox, and it will display the result in the same DataGridView, but it's not working at all, I know I miss something important but I've no idea what it is. Can somebody please help?

Return multiple values from store procedure

$
0
0

Is it possible to return multiple values from a stored procedure?  Basically, if I execute the stored proc on the C# side, then on the SQL side I do multiple calculations.  Let's say I have 5 int values I need returned to the C# side.  Is it possible to get those values all in one trip to the database?

SQL Server Recovery

$
0
0

Dear sir ..

by mistake i have deleted all the records in my database ( SQL 2000 Database ) , is there any way to get back my records ???

i don't have back ... is there any tool for recovering my database ??

please help me out ..

 

 

Web Service using Oracle Stored Procedure Which returns a number and a varchar

$
0
0

 

<div mce_keep="true">Hi, </div> <div mce_keep="true">I am creating a webservice which will call an Oracle Stored Procedure.</div> <div mce_keep="true">The stored procedure returns a number and varchar for example:</div> <div mce_keep="true"> </div> <div mce_keep="true">create or replace procedure anil_test(x_user_name OUT varchar, x_email_id OUT varchar, x_user_id OUT number, p_user_name IN varchar)</div> <div mce_keep="true">is</div> <div mce_keep="true">begin</div> <div mce_keep="true">select user_name,email_id,user_id</div><div mce_keep="true">into x_user_name,x_email_id,x_user_id</div> <div mce_keep="true">from all_users</div> <div mce_keep="true">where user_name = p_user_name;</div> <div mce_keep="true">end;</div> <div mce_keep="true">I created a webservice which kind of looks as below. I tried to consume the web service but no data shows up.</div> <div mce_keep="true">I was researching and all the examples I found were using a procedure for which the out put is a cursor. The procedures were too simple and the cursor is just a select statement. </div> <div mce_keep="true"> </div> <div mce_keep="true">I would appreciate it if any one of you can point me to some direction or give me a hint on how to solve this issue.</div> <div mce_keep="true"> </div> <div mce_keep="true">Thanks</div> <div mce_keep="true">Anil</div>

 

 

[WebMethod]

public DataSet UserEnvInfo() {

OracleConnection con = new OracleConnection();

DataSet UserInfo = new DataSet();

try

{

con.ConnectionString = "User ID=username;Password=password;Data Source=devdb";

con.Open();

OracleCommand comm = new OracleCommand("ANIL_TEST", con);

comm.CommandType = CommandType.StoredProcedure;

OracleParameter param = new OracleParameter( x_user_name , Oracletype.Varchar, 30);

param.Direction = ParameterDirection.Output;

comm.Parameters.Add(param);

comm.ExecuteNonQuery();

 

 

OracleDataAdapter adapter = new OracleDataAdapter(comm);

adapter.SelectCommand = comm;

adapter.Fill(UserInfo);

 

 

}

catch (OracleException oex)

{

string error = oex.Message;

}

 

return UserInfo;

}

VS 2012 Freezes after adding SQLDataSource and configuring it to use IBM DB2 UDB for iSeries Data Provider...

$
0
0

Hello,

I create an empty web site, add a form, add a reference to the project for the ibm db2 udb for iseries .net provider.  Then, I drop a SqlDataSource control on the form and proceed to configure it.

I configure it to use .NET Framework Data Provider for OLE DB Data Source, and then the IBM DB2 UDB for iSeries IBMDASQL OLE DB Provider.  I enter the name of the server, user and password.  Then, I click on the Test Connection button and it comes back OK.

After that, I click NEXT and check the Specify a custom SQL statement or stored procedure and that’s when VS2012 freezes.  I get no response whatsoever. The screen goes “cloudyish” and  I have to close VS2012 and restart.  I have tried uninstalling and reinstalling but get the same thing.  I wonder if anyone has had this happen and how it was resolved. 

I did find out, however, that what I'm trying to do works in VS 2005.  I'm getting the same problem in VS2008, 2010, and 2012.  

I can get connected to the iSeries via code (connecting to the DB, preparing SQL statement, and then populating the grid) but if I do it through the wizard, VS2012, 2010, and 2008 they all freeze.

If you have any suggestions, I will be happy to try them.

Thanks for any help you can provide...

Antonio Mira

Unlock User Account after Validation?

$
0
0

I need to traget SQL database to unlock user account only if its locked.    The code below will execute even if someone just type in 123.    

I need to add additional code so it'll run SELECT * FROM user_profile WHERE user_id =Request.Form("user_id")  AND If the user_id exist in table, then exec stored procedure to unlock account.  Can someone please help me.  

ASP Page Code

<%@ImportNamespace="System.Data.OleDb"%><!DOCTYPEHTMLPUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN"><html><body><formaction="un.aspx"method="post">
Your name: <inputtype="text"name="user_id"size="20"><inputtype="submit"value="Submit"><!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --><%If(Request.Form("user_id")<>"")ThenDimdbconn,sql,dbcomm,dbread,connStr'Create Database Connection.connStr="Provider=sqloledb;Data Source=DEV2;Initial Catalog=CTest;User Id=xyz;Password=$@BCDE;"dbconn=NewOleDbConnection(connStr)dbconn.Open()'QUERYSQL = "exec pr_unlock '" + Request.Form("user_id") + "'"dbcomm=NewOleDbCommand(sql,dbconn)dbread=dbcomm.ExecuteReader()Response.Write("<i>"+Request.Form("user_id")+" has been unlocked</i><p>")dbread.close()EndIf%><!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --></body></html>

 

SQL Stored Procedure

ALTER procedure [dbo].[pr_unlock]

       @user_id varchar(8)

 AS

       UPDATE user_profile

           SET logon_retry_count='0',

                  updated_by = 'admin',

                  update_time = GETUTCDATE()

      WHERE       user_id =@user_id AND         logon_retry_count<>0

      AND         active_flag=1  -- only active users



delete file from repeater

$
0
0
<td><a href='Upload/<%#Eval("IF_FileAddress")%>' target="_blank">see file</a></td><td><a       ?????                     delete file</a></td></td>

hi h have a repeater and i show the file in Upload folder to user

now i want a link that  when user click on it,th file will be delete

how can i do it?

paging with custom class objects

$
0
0

Hi,

I have created some custom class objects.

public class astroObjects
{

public int Id { get; set; }

public String Name { get; set; }

public String Desc { get; set; }

public int CatId { get; set; }

public String ImageThumb { get; set; }

}

My data is stored in an SQL database.

When I want to display the data I query the database and make a list as so.

public static List<astroObjects> GetAstroObjects(int catId)
{
List<astroObjects> astroobjects = new List<astroObjects>();

// Do all sql work including setting up connection, command, ect.

SqlConnection conn;
SqlCommand comm;
SqlDataReader reader;
String mySQL;

int thecatid = catId;

mySQL = "SELECT objectName, object_id, Desc, objectThumbnail WHERE CatId = @catId ORDER BY objectName";


string connectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
conn = new SqlConnection(connectionString);
comm = new SqlCommand(mySQL, conn);

comm.Parameters.Add("@catid", System.Data.SqlDbType.Int);
comm.Parameters["@catid"].Value = thecatid;


conn.Open();

reader = comm.ExecuteReader();


while (reader.Read())
{

astroObjects c = new astroObjects();
c.Name = reader["ObjectName"].ToString();

c.Desc = reader["Desc"].ToString();

c.Id = Convert.ToInt16( reader["object_id"]);
c.ImageThumb=reader["ObjectThumbnail"].ToString();

astroobjects.Add(c);
}

return astroobjects;
}

I next want to bind this list to a datalist.

Most examples of paging to datalist on the web I have seen are using dataset but I read this old article online http://www.dotnetcurry.com/ShowArticle.aspx?ID=345 that says you can just bind to a pageddatasource so have done the following:

protected void getTheData(int catid)

{

PagedDataSource page = new PagedDataSource();

page.AllowCustomPaging = true;
page.AllowPaging = true;

page.DataSource = myproject.astroObjects.GetAstroObjects(catid); 
page.PageSize = 10;

page.CurrentPageIndex = CurPage; 

Decimal intNumRecs;
intNumRecs = 50;//need to replace with actual number of records returned in the query 

Decimal numPages;
numPages = Math.Ceiling(intNumRecs / page.PageSize); 

int strCurPage;
strCurPage = Convert.ToInt16(CurPage) + 1; 

LabelCurrentPage.Text = "Pg: " + strCurPage + " of " + numPages + " (" + intNumRecs + " objects)";

ButtonBack.Visible = (!page.IsFirstPage);
ButtonNext.Visible = (!page.IsLastPage);

DataList1.DataSource = page;

DataList1.DataBind();

}

and here's the code for my next and previous buttons

public void Next_Click(Object obj, EventArgs e)
{


//identify current datafilter

CurPage += 1;

getTheData(Convert.ToInt16(ViewState["DataFilterId"]));


}


public void Prev_Click(Object obj, EventArgs e)
{


CurPage -= 1;

getTheData(Convert.ToInt16(ViewState["DataFilterId"]));

}


and here's my page load code 

protected void Page_Load(object sender, EventArgs e)
{

checkloggedin();

if (!IsPostBack) //if page loaded not for first time
{


getAstroObjectsById(0); //set default recommedations filter to other related products
CurPage = 0;

}

if (IsPostBack) //if page loaded for first time
{

CurPage = Convert.ToInt32(ViewState["CurPage"]);

}

}

Here's how I set CurPage variable (Current page)


public int CurPage
{
get
{
if (this.ViewState["CurPage"] == null)
return 0;
else

return Convert.ToInt16(this.ViewState["CurPage"].ToString());

}
set
{
this.ViewState["CurPage"] = value;
}

}

and here's how I handle DataFilterId variable (category in the query)

public int DataFilterId
{

get
{
if (this.ViewState["DataFilterId"] == null)
return 0;
else

return Convert.ToInt16(this.ViewState["DataFilterId"].ToString());

}
set
{
this.ViewState["DataFilterId"] = value;
}
}

When I visit the page 10 records are displayed as expected. However when I click the next button the next 10 records aren't shown but the right page number is.

I can't figure why this isn't working.

The article uses Linq and I want to just do an SQL query as in the my list code above. I need to just query database so just the amount of records I need are retrieved from the database and added to the list.

Hope some one can help me.

Cheers

Mark :)

How to set a select criteria (Where Username != "ABC") in ?

$
0
0

Hi,

I'm working on a WebForms website application using c#. I need to add a select criteria in an existing <asp:ObjectDataSource>, but have not found how to do this. What I want to do is toselect ONLY rows where username != "ABC"....

Here is my current code in .aspx:

<asp:ObjectDataSource ID=".." runat="server" SelectMethod="UICustomerSearch" FilterExpression="Select from TableA where @Username != 'ABC'"(I'm trying to add a select criteria here) .....>

    <SelectParameters>

         <asp:ControlParameter  ControlID="H_Fltr$txtFirstName"   Name="firstname" PropertyName="Text" Type="String">

          ....

         <asp:ControlParameter  ControlID="H_Fltr$txtUserName"   Name="username" PropertyName="Text" Type="String"> //Note: or should I do something here, add a select criteria in this line?I cannot use "DefaultValue=...." here, because I want to find the opposite, when a row's value for username field is NOT a certain value.

    </SelectParameter>

</asp:ObjectDataSource>

I hope that I'm clear on what I want to achieve...Anyone have a suggestion?

Thanks a lot!

Claudia

checkbox null value binding expression

$
0
0

i have this in my formview bound with sqldatasource

<asp:CheckBox ID="chkBoolNullVallueFromDB" runat="server"
                                                Checked='<%# Bind("BoolNullVallueFromDB") %>' />

when i run my application i get this error : "String was not recognized as a valid Boolean."

i also tried this:

Convert.ToBoolean(Eval("value"))
Convert.ToBoolean(Bind("value"))



database contains null value for that of course.

how can i check for null in binding expression?

Encryption Decryption in Sql Server 2008

$
0
0

Migrated from Oracle to SQL Server 2008.

Problem occuring while converting procedure from oracle to sql..

oracle proc using below inbuilt functions:

UTL_RAW.CAST_TO_RAW()
dbms_obfuscation_toolkit.DESEncrypt()
RAWTOHEX()

Is there any equilent functions in sql or how can do this with sql server?

Report definition invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded.

$
0
0

Using VS 2010 Attempting to create a report using MSAccess 2010 database as the datasource.
This error displays upon attmepting to run the report.

If this makes any difference:
The database ("Inventory.acccdb") is in the App_Data folder, and the report ("BarCodeReprt.rdlc") is in theApp_Code folder.

Other than that I cannot understand how this is to work.

Thank you!

Issues with SqlDataSource in aspx

$
0
0

I have some data types and stored procedures issues, when I want to create a sqlDataSource in aspx page and assign session parameters (type int). My idea is to do this in codebehind due to an easier debugging. I’m new to all this and I am quite interested in hearing opinions. My code is below:

protected void DoReport()
    {
        int cID = Convert.ToInt32(Session["cID"]);
        using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connection1"].ConnectionString))
        {
            using (SqlCommand cmdHist = new SqlCommand("GetDetailHistory", conn))
            {
                cmdHist.CommandType = CommandType.StoredProcedure;
                SqlParameter pclinic = cmdHist.Parameters.Add("@CID", SqlDbType.Int);
                pclinic.Value = cID;
                SqlParameter pCMMID = cmdHist.Parameters.Add("@CMID", SqlDbType.Int);
                pCMMID.Value = Convert.ToInt32(ddlMeasure.SelectedValue);

                SqlDataSource DsHist = new SqlDataSource();
                gvHistory.DataSourceID = "DsMeasureHist";
                conn.Open();
                DsHist.ExecuteNonQuery();
                gvHistory.DataBind();
            }
        }
    }

How do I get current LINQ Datasource field value

$
0
0

Hello,

I want to put into a text box the value from the current row of a linq datasource.  If I have it hooked up to a grid, I can go to that cell and pull it out but rather than have it in a grid I want it straight to a text box.

How do I get at a column value for the current row?  For example:

StartDate = CDate(gvCerts.SelectedRow.Cells(2).Text) <<< this sets startDate to the grid cell value that is connected to my linq datasource.

What would I do to hook a text box up directly, say something like (but I know this isn't it):

Textbox1.text = LinqDataSource1.whateverTheCurrentRowIs.Field("StartDate")

Get error at ExecuteNonQuery() during INSERT data into table

$
0
0

Hi,

In my program, during insert the data into table, I get this error: 'One or more errors occurred during processing of command. ORA-00936: missing expression' at ExecuteNonQuery().

This is the table I try to insert the data.

CREATE TABLE Product
(
name        varchar2(10) not null,
category    varchar2(10) not null,
facility    varchar2(10) not null,
quantity    numeric(20,0) not null,
time_stamp  date not null
)

Below is the code for insert the data.

public static string cs = "Provider=MSDAORA; Data Source=xxx; User ID=xxx; Password=xxx";
public void insertCom()
        {
            DataTable dt = new DataTable();
            dt = _Ds.Tables[0].Copy();

            OleDbConnection con = new OleDbConnection(cs);
            con.Open();

            for (int j = 0; j < dt.Rows.Count; j++)
            {
                string name = dt.Rows[j]["name"].ToString();
                string category = dt.Rows[j]["category"].ToString();
                string facility = dt.Rows[j]["facility"].ToString();
                int qty = int.Parse(dt.Rows[j]["quantity"].ToString());
                string timestamp = dt.Rows[j]["time_stamp"].ToString();

                string insert = "INSERT INTO Product (name, category, facility, quantity, time_stamp)" +
                                " VALUES (@name, @category, @facility, @quantity, to_date('@timestamp', 'mm/dd/yyyy'))";

                OleDbCommand cmd = new OleDbCommand(insert, con);
                cmd.Parameters.AddWithValue("@name", name);
                cmd.Parameters.AddWithValue("@category", category);
                cmd.Parameters.AddWithValue("@facility", facility);
                cmd.Parameters.AddWithValue("@quantity", qty);
                cmd.Parameters.AddWithValue("@time_stamp", timestamp);

                cmd.ExecuteNonQuery();  // <-- ERROR OCCUR HERE !!
            }
            con.Close();
        }

I did search for the solution for this error, unfortunately still cannot be solve. I have no idea how to solve this.

Want my dropdownlist to populate only data from the selection to the GridView..

$
0
0

Hello,

I've got a dropdownlist control and a GridView control. I think I'm close but I need a little help.

When I select an Item from the dropdownlist control, I would like for the GridView to select only data from the "Name" that is selected.

Instead, I get everything in the table.

Any ideas?

My code...

<asp:dropdownlist id="ddlClients" runat="server" appenddatabounditems="True" autopostback="True"
datasourceid="sdsClients" datatextfield="Name" datavaluefield="ID"><asp:listitem text="Select a Client" value="-1"></asp:listitem></asp:dropdownlist><asp:sqldatasource id="sdsClients" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" selectcommand="SELECT * FROM [Current]"></asp:sqldatasource><asp:sqldatasource id="Sqldatasource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
selectcommand="SELECT * FROM [Current] WHERE ([ID] = CASE WHEN @ID = -1 THEN [ID] ELSE @ID END) ORDER BY [Name]"><selectparameters><asp:controlparameter controlid="ddlClients" name="ID" propertyname="SelectedValue"
type="Int32" /></selectparameters></asp:sqldatasource><strong><p>Client Details</p><asp:gridview id="gvClient_Details" runat="server" autogeneratecolumns="False" datakeynames="ID"
datasourceid="sdsClients" style="margin-top: 12px;" Width="783px"><columns><asp:boundfield datafield="Name" headertext="Name" sortexpression="Name" /><asp:boundfield datafield="Location" headertext="Location" sortexpression="Location" /><asp:boundfield datafield="Street" headertext="Street" sortexpression="Street" /><asp:boundfield datafield="System" headertext="System" sortexpression="System" /><asp:boundfield datafield="Payment" headertext="Payment" sortexpression="Payment" /><asp:boundfield datafield="Server" headertext="Server" sortexpression="Server" /><asp:boundfield datafield="Phone" headertext="Phone" sortexpression="Phone" /><asp:boundfield datafield="Circuit_Provider" headertext="Circuit Provider" sortexpression="Circuit_Provider" /><asp:boundfield datafield="Location" headertext="Location" sortexpression="Location" /><asp:boundfield datafield="Circuit_ID" headertext="Circuit ID" sortexpression="Circuit_ID" /><asp:boundfield datafield="Location" headertext="Location" sortexpression="Location" /><asp:boundfield datafield="Server_Login" headertext="Server Login" sortexpression="Server_Login" /></columns></asp:gridview>

GRIDVIEW HELP

$
0
0

Hello there i have a gridview which gets populated from a sqldatasource. 

This gridview serves as a session. Where i want to give members the ability to delete only their sessions.

The second colum of the gridview displays the Members name. I am trying to filter the gridview with user.identity.name on load but i cannot find a single way to success. 

The result i need is to display only the sessions from the user.identity.name. 

Please help.

Microsoft oledb data acces truncates the data length to 255 characters

$
0
0

Hi all

   When i use microsoft oledb driver for excel import, it truncates the data to 255 characters. 

string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+ FilePath +";"+ "Extended Properties='Excel 8.0;HDR=YES;MAXSCANROWS=0;IMEX=1'";

Please provide some solutions

Viewing all 956 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>